|
From: Roger H. <rog...@mi...> - 2004-03-03 19:01:41
|
Maybe we should get Q3Vector3D_Normalize to check for 1 and -1 in its result, and if found, set the other components to zero. Roger. > Initial Comment: > Some input values for > Q3Quaternion_SetRotateVectorToVector produce duff > quaternions. > > Example: > > start vector: > -0.2252647,-0.8941119,-182972.5 > > put through Q3Vector3D_Normalize gives > -1.231140e-6,-4.886592e-6,-1 > > Now do Q3Quaternion_SetRotateVectorToVector with > the following parameters: > v1=-1.231140e-6,-4.886592e-6,-1 > v2=0,0,1 > > the resulting quaternion is (0,-INF,INF,NAN) > > This problem occurs on Mac OS X Quesa, I am unable to > reproduce it on Windows. > > To workaround this case, I just detect magnitudes <1e- > 5 and set them to 0, and hence v1 becomes 0,0,-1, > which then works correctly. > |