- Home /
with quaternion how rotate around global Y ?
my code is this
Quaternion q = Quaternion.AngleAxis(Time.deltaTime * 10f, Vector3.up);
transform.rotation *= q;
but this rotate local y axis, how convert this code to rotation global y axis?
adding to the great simple answer: http://answers.unity3d.com/questions/171380/camera-relative-free-orbit.html
Answer by mrde · Jan 23, 2011 at 12:23 AM
resolved.
Quaternion q = Quaternion.AngleAxis(Time.deltaTime * 10f, Vector3.up);
transform.rotation = q * transform.rotation;
Answer by Scribe · Jan 22, 2011 at 10:51 PM
function Update() {
transform.RotateAround (Vector3(0, 0, 0), Vector3(0, 1, 0), 1);
}
to do what your saying this would be my method but i wouldn't know how to do it using quaternion
hope it helps anyway
fine. it runs. but i need to create a Quaternion and multiply with transform.rotation, if it's posible ?
Your answer
Follow this Question
Related Questions
Manual Quaternions 3 Answers
Child versus Parent rotations 3 Answers
Rotate a vector 2 Answers
Instantiate based on RaycastHit.normal 1 Answer
Figuring out the correct amount of torque to apply? 2 Answers