chandlerprall / GoblinPhysics

Collision Detection & Response in JavaScript
http://www.goblinphysics.com
Other
147 stars 18 forks source link

Use THREE.Euler.DefaultOrder = "YXZ" in exampleUtils.js #47

Open elisee opened 9 years ago

elisee commented 9 years ago

The camera in the various demos (for instance, http://www.goblinphysics.com/examples/constraint-revolute.html) rotates in weird ways because the default "default Euler order" is set to "XYZ" in Three.js. By adding:

THREE.Euler.DefaultOrder = "YXZ";

at the start of exampleUtils.js, it should fix the issue and your camera will stay parallel to the ground.

chandlerprall commented 9 years ago

Thanks for the tip! I think some of the demos lose effect if they can't rotate freely along all axes. However, it makes sense for others such as the one you linked. I'll give it some thought.

chandlerprall commented 8 years ago

Three now has an OrbitControls class which keeps the camera's Y axis stable.