I was very excited when I first saw this example ( webgl_geometry_minecraft_oculusrift ) in mrdoob / three.js Β· GitHub . Sure, it's pretty amazing!
But I'm curious how to apply this effect to other examples? Therefore, I am trying to implement this effect in "webgl_interactive_cubes". However, the experimental result is worse than expected.
My problem is that I canβt precisely align the cursor with a specific cube so that it changes color, it seems to be a problem with the projection function? Then I adjusted the screen width coefficient, like this
window.innerWidth * 2
throughout the program. But still can not improve this problem.
My problem summary:
If I want to apply the Oculus Rift effect on any example , how do I do it? in my opinion, I added only the following code
effect = new THREE.OculusRiftEffect( renderer ); effect.setSize( window.innerWidth, window.innerHeight );
in the initialization of the init(); block init(); and the final added effect.render( scene, camera ); in render();
I am very curious to find out how
var vector = new THREE.Vector3( mouse.x, mouse.y, 1 ); projector.unprojectVector( vector, camera );
working. Why pass parameter 1? what if i change mouse.x to mouse.x * 2
The need to use two monitors can be fully represented only by this effect?
Note: my English is not very good, if I described it unclear, please ask your doubts, I will reply as soon as possible.
This is my DEMO link:
My folder: https://googledrive.com/host/0B7yrjtQvNRwoYVQtMUc4M1ZZakk/
Andywhite
source share