如何在“webgl_interactive_cubes”示例中使用“OculusRiftEffect.js”

7
我第一次看到webgl_geometry_minecraft_oculusrift这个例子时非常兴奋,它在mrdoob/three.js · GitHub网站上非常棒!
但我很好奇,如何将此效果应用于其他示例?所以我尝试在“webgl_interactive_cubes”中实现此效果。然而,实验结果比预期的要差。
我的问题是我无法准确地将光标对准特定的立方体以使其改变颜色,似乎是投影函数的问题?然后我调整了屏幕宽度系数,像这样:

window.innerWidth * 2

在整个程序中。但仍然无法解决这个问题。
总结我的问题:
  1. If I want to apply Oculus Rift Effect on any example, how should I do? by th way, I only added the following code

            effect = new THREE.OculusRiftEffect( renderer );
            effect.setSize( window.innerWidth, window.innerHeight );
    
            // Right Oculus Parameters are yet to be determined
            effect.separation = 20;
            effect.distortion = 0.1;
            effect.fov = 110;
    

    in initialize block init(); and final added effect.render( scene, camera ); in render();

  2. I am very curious to know how

    var vector = new THREE.Vector3( mouse.x, mouse.y, 1 ); projector.unprojectVector( vector, camera );

    works. Why do need to pass parameter 1? what if I change mouse.x to mouse.x * 2

  3. Need to use dual monitors can only be fully present this effect?

注意:我的英语不是很好,如果我描述的不清楚,请提出你的疑问,我会尽快回复。
这是我的演示链接:
  1. http://goo.gl/VCKyP

  2. http://goo.gl/xuIhr

  3. http://goo.gl/WjqC0

我的文件夹:https://googledrive.com/host/0B7yrjtQvNRwoYVQtMUc4M1ZZakk/


1
你能分享一下修改过的webgl_interactive_cubes的链接吗? - mrdoob
我必须在文章底部制作链接URL。 - AndyWhite
1个回答

0
第三个是你的例子对吗?
这可以帮助您更轻松地使用OR效果: https://github.com/carstenschwede/RiftThree 您的示例都有效,只有第三个在控件方面存在问题。如果我从统计信息DIV(FPS)中拖动移动,它会起作用。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接