|
From: Keith W. <kw...@cs...> - 2005-02-24 07:02:23
|
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? Thanks, as always. ________________________________________________________________________ Keith Wiley kw...@cs... http://www.unm.edu/~keithw "Yet mark his perfect self-contentment, and hence learn his lesson, that to be self-contented is to be vile and ignorant, and that to aspire is better than to be blindly and impotently happy." -- Edwin A. Abbott, Flatland ________________________________________________________________________ |