Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Add 'up' property to Object3D #141

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Blackth0rn
Copy link

Added the 'up' property to the Object3DDescriptor class to allow setting the 'up' vector for cameras (and other objects), see: https://threejs.org/docs/?q=Cam#Reference/Core/Object3D.up for THREE documentation on the property.

Added a brief item to the documentation for the Object3D class to note the new property being added.

@toxicFork
Copy link
Collaborator

Hmm... this is one of those special cases where we may need to decide on priority:

  • quaternion
  • rotation
  • forward (missing from three) and up (not missing)

I am thinking if quaternion exists use that, then rotation, then fwd/up perhaps? Any thoughts?

@Blackth0rn
Copy link
Author

I hadn't thought of that, was just following what three.js had and trying to work out why my camera was sideways :)

Using the rotation or quaternion sounds pretty reasonable however from looking in the three.js source it seems that the 'up' property is only used by the Object3D.lookAt function. In this function (https://github.com/mrdoob/three.js/blob/dev/src/core/Object3D.js#L274) the rotation/quaternion seem to be ignored so I guess the 'up' value could be defaulted to the rotation/quaternion if the 'up' prop isn't set on an Object3D, which would be the opposite priority order to what you have listed though. 'up' is used if set, if not then check for a quaternion or rotation and use that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants