richtr / threeVR

An orientation-aware Virtual Reality controller for web browsers built on top of three.js
http://richtr.github.io/threeVR/examples/vr_basic.html
439 stars 97 forks source link

CSS3DRenderer doesn't work with the latest revision of Three.js #11

Open Hexrays opened 8 years ago

Hexrays commented 8 years ago

Hi, I have been testing out the library with the latest revision of Three.js, 73, and found that it works great with the WebGLRenderer but when I switch to the CSS3DRenderer, DeviceOrientationController stops functioning. The sides are loaded but they don't move. But I found when I revert back to 71 it works fine again. It's also broken in 72.

I started looking into it but I'm new to Three.js so I haven't been able to track down what change broke it. Thanks!

liuxiaoyue commented 8 years ago

modify CSS3DRenderer.js -if ( camera.parent === undefined ) camera.updateMatrixWorld(); +if ( camera.parent === null ) camera.updateMatrixWorld();

demo success!

Hexrays commented 8 years ago

Excellent! It works. Thanks so much for looking into this!