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
mechanicarm.RotateAround(mechanicarm.position, Vector3.up,-0.5f);
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
LookAt, SetRotation or SetLookRotation
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 mechanicalarm.InverseTransformDirection(mechanicalarm.up)
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.
thanks.