Skip to content

Conversation

@WestLangley
Copy link
Collaborator

Fixes #4375. Previously, the orbit axis was hardwired to be the y-axis.

We'll see how this is received. Optionally, it could be limited to just z-is-up and y-is-up, which I believe are the two cases of interest. By limiting the options, it would likely be easier to avoid edge cases, which may come up.

Also added a new function that was required for this feature: Quaternion.setFromUnitVectors( vFrom, vTo ), which sets the quaternion to the rotation required to rotate direction vector vFrom to direction vector vTo.

Finally, although unrelated, TrackballControls was generating too many change events. Fixed.

ping @jasongrout
ping @ekatzenstein

@mrdoob mrdoob merged commit 796363c into mrdoob:dev Mar 4, 2014
@mrdoob
Copy link
Owner

mrdoob commented Mar 4, 2014

Sweet! Thanks!

@jasongrout
Copy link

Awesome! Thanks! Our 3d graphics in the sage cell server (like http://sagecell.sagemath.org/?q=yrpjbv) will appreciate this!

@jasongrout
Copy link

To clarify, if we update the object's up vector after creating the controls, this will not automatically update the controls, right?

@WestLangley
Copy link
Collaborator Author

To clarify, if we update the object's up vector after creating the controls, this will not automatically update the controls, right?

You cannot change the up vector after creating the controls.

This is tricky, and as implemented there are difficult edge cases. That is why I suggested perhaps limiting it to only two options -- y-up and z-up.

@jasongrout
Copy link

Sure. My use-case is the z-up, and this seems to work great. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OrbitControls rotates object confusingly when camera.up is (0,0,1)

3 participants