> From: Erik Hofman 
> 
> Harald JOHNSEN wrote:
> 
> > A cloud is represented by multiple billboard primitives. Above a certain 
> > distance they are replaced by an impostor (one quad).
> > When they are near I draw all their billboards, each having its viewing 
> > angle to face the camera. It's that angle that must be locked above a 
> > certain value.
> 
> I think this is the same problem that the viewer code has when looking 
> straight up (or straight down). It supposedly has something to do with 
> the rotation matrix and should be solved by using quaternations.
> 
> Now, if I only knew what those are 
> 


This describes the matrix conversions and the problem with them:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/

You can see it in flightgear by going into chase view and looking straight down 
at the aircraft (scenery normal 0,0,0).  The "camera" and hence the whole scene 
will start doing rapid rotations.

This describes the Quaternian:
http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/index.htm

You don't really need to understand how a quaternian works to use one.  There 
are quaternian objects and methods in plib that correspond to the matrix 
methods now used in the veiwer and model position/animation code (see plib's 
sgQuat class).  You can convert between quats and matrices and concatenate 
multiple quats just like the matrices.

Now that the viewer code is pretty stable it might be a good time to try to 
convert.  Norman has suggested this to me serveral times in the past and I've 
pretty much tried to ignore him :-).  I think my concern was with the prospect 
of trying to fix a rotation related bug when everything is quaternian.  
Matrices on the other hand are pretty easy to visualize if you've been working 
with them for a little bit.  As much as I've looked at examples I haven't been 
able to do that with quats.   But since we know the viewer code works pretty 
well, then we could probably go ahead and switch it.  I guess if a problem did 
come up we could alway convert the quaternian to a matrix and dump the 
resulting matrix.

Best,

Jim



_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to