Re: [Celestia-developers] New center command
Real-time 3D visualization of space
Status: Beta
Brought to you by:
cjlaurel
From: Christophe T. <ch...@te...> - 2003-08-28 18:45:17
|
Le Jeudi 28 Ao=FBt 2003 19:26, Chris Laurel a =E9crit : > > // rotation1 along OP brings u to the SOP plane. > > // nSOP normal to SOP plane > > // nuOP normal to uOP plane > > Vec3f nSOP =3D v ^ w; > > Vec3f nuOP =3D u ^ w; > > I think that you need to normalize nSOP and nuOP . . . If they're not > unit vectors, the length of their cross product won't be the sine of th= e > angle between them (as you assume a few lines down.) Of course! But anyway even the axis of rotation is wrong... > I'm off to work in a few minutes so I don't have time to think this > through thoroughly, but . . . I'd recommend using slerp to interpolate > between the quaternions directly rather than converting to axis/angle a= nd > then back. I'm not really used to quaternions yet. I thought of using slerp to=20 interpolate, but prefered to keep it simple until I got it working with t= wo=20 stages. > If you're going to use orbit, I think what you want to do is compute tw= o > orientations: q1 at t, and q2 at t + dt. Then find the rotation q such > that: > > q1 * q =3D q2 > > q =3D ~q1 q2 > > (where ~ indicates the conjugate, as in Celestia) Quaternions obviously make things simpler... > Then, call orbit with q . . . I think that should work, though there m= ay > be an easier way to do all this that doesn't involve using orbit. I wanted the movement to be the same than when using the RMB, that's why = I=20 used orbit. -- Christophe |