- Home /
Question by
robinking · Nov 25, 2010 at 01:36 PM ·
javascriptquaternion
Quaternion.TransformPoint?
Take the following code:
foo = transform.TransformPoint(0,0,1);
I would like to be able to do the same without having to directly use a Transform. Sort of like:
foo = transform.rotation;
bar = Vector3(0,0,1);
foobar = transform.position + Quaternion.TransformPoint( foo, bar );
I can't work out if there is such a function or not. It seems I'm after the reverse of Quaternion.LookRotation?
Comment
Best Answer
Answer by Mike 3 · Nov 25, 2010 at 02:22 PM
TransformPoint is just quaternion * vector, like such:
foobar = transform.position + foo * bar;
Your answer