|
From: James W. W. <os...@jw...> - 2005-02-24 07:15:41
|
On Feb 23, 2005, at 11:02 PM, Keith Wiley wrote: > I have an object that has not been rotated at all yet, so its starting > quaternion Q is (1,0,0,0). I have a vector V (x,y,z) that specifies a > 3D pointing or facing direction. I would like to take the object's > facing direction, which starts out (0,0,1), straight down the z axis, > and orient it such that it faces in the same direction as the vector > V. I realize this doesn't entirely specify an orientation since there > is still the question of how the object is "rolled" around the facing > vector, but I am not concerned with that right now. For this specific > application it doesn't even matter because the object in question is > perfectly cylindrical around the z axis so rolling doesn't mean > anything. I just want to make it point in the direction of the vector > V. > > How do I do this? Any ideas? How about using Q3Quaternion_SetRotateVectorToVector? -- <http://www.jwwalker.com/> |