I was very excited when I first saw this example (webgl_geometry_minecraft_oculusrift) in mrdoob/three.js · GitHub website. Undoubtedly, it's pretty awesome!
But I'm curious, how to apply this effect on other examples? So I try to implement this effect in the "webgl_interactive_cubes". However, the experimental result is worse than expected.
My problem is that I can't accurately align the cursor to a particular cube to make it change color, seems to be a problem with the projection function? Then I adjusted the screen width coefficient, like this
window.innerWidth * 2
in the whole program. But still can not improve this problem.
Summary my issue :
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 addedeffect.render( scene, camera );
inrender();
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
tomouse.x * 2
Need to use dual monitors can only be fully present this effect?
Note: My English is not very good, if I have described is unclear, please ask your doubts, I will respond as soon as possible.
This is my DEMO link:
My Folder : https://googledrive.com/host/0B7yrjtQvNRwoYVQtMUc4M1ZZakk/