Jump to content

How to set absolute values for local rotation?


Recommended Posts

I know how to get world rotation from the rotation quaternion using the eulerAngles function.  I know how to set the world rotation using the RotationYawPitchRoll function.  I also want to have the option to read and set local rotation but I have no idea how to do this using the rotation quaternion.  I've checked the docs and searched the forums but I can't find an example.  Does anyone know if its possible to read and set absolute local rotation?

Link to comment
Share on other sites

3 minutes ago, Deltakosh said:

If you are using a mesh then mesh.rotationQuaternion is the local rotation

oh right, so mesh.rotationQuaternion is actually storing the local rotation.  I got it backwards.  So how do I set and retrieve the world rotation?

Link to comment
Share on other sites

4 minutes ago, adam said:

If the mesh doesn't have a parent, isn't the rotationQuaternion both local and world?


Actually, you have a good point here. I'm trying to rotate this object in relation to the ground via local and world rotations, but I guess I need to make it a child of the ground first

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...