- Home /
Rotate a transform's Quaternion by a Vector3 axis
Hello there. I'm working on a space exploration game and I'd like to add rotation axes for the planets. Each planet should have a rotational axis. In the initialisation of the planets, I'd like their transform.rotation Quaternions to be rotated to 'match' their rotation axis.
I've seen how you can .Set a Quaternion's rotation using a Vector3, but (unless I have this wrong) that method provides x, y and z as degrees of rotation; I'd like to rotate the Quaternion by a normalised Vector3 axis, which I can then use as the 'up' in the planet's on-going rotations.
I hope that makes sense. Any idea how I can rotate a transform so that 'up' on the model matches an axis?
Your answer
Follow this Question
Related Questions
Rotate Object Around Local X Axis , then Local Y Axis, then Local Z Axis (like a turtle) 0 Answers
How to find or compute or look for overall/max RPM by simply checking for rotation? 1 Answer
Rotation changing in untouched axis 1 Answer
Vector3 - Rotate a cube by its spatial (longer) diagonal 1 Answer
Recoil function: smoothly rotation 1 Answer