I am still pretty thick regarding trigonometry problems, and have a hard time figuring out the correct solution, despite my intermediate knowledge in vectors, transforms, matrixes, rotations, etc.
What I basically need, is to always know the equivalent of 'vector3.up' in a local transform's rotation. The problem is that, since this transform's rotation is random, it's axes are most surely different from the world axes, and I'm at a loss about what kind of transforms I need apply to know the 'localvectorup' to determine 'where' is it's 'world.vector3.up' equivalent in local space.
I know that my setting is ok because if I use
it correctly rotates in the horizontal plane, regardless of how twisted its local transform is. The problem is, i don't know the direction of the rotation, nor its intensity, so I need to use
to set its orientation in the horizontal plane based on another object's transform: what i basically need is to rotate 'mechanicalarm' around the 'vector3.up' regardless of mechanicalarm's local rotation and axes orientations.
To clarify further: I don't need to find the arm's 'up' vector in respect to the world vector,which I can achieve through
For a start, I think I need to find the vector which, in mechanicalarm's local coordinate space, is -always- parallel to the world's Vector3.up, regardless of mechanicalarm's rotation SIGH! So damn difficult :(
Wonder if any of you trigonometry gurus out there can help me understand what are unity's correct functions to use to reach my goal.
I'm thinking it may be helpful to restate the actual problem, if only just for yourself. Some things that may be helpful:
o You wrote you tested with
o Almost nothing takes local coords as input. Are you sure you need them? RotateAround takes the axis in World; DrawRay takes the dir as World;
Are you sure you don't just want
answered Aug 10 '11 at 08:59 PM
This seems to be it (world up in local coords):
My test code, with comments on the logic behind it. I think a better way (for me) would have been to note that
Keeping the locals and worlds straight is a real stumper. For example, the description of
answered Aug 09 '11 at 07:24 PM