Hello,

This question is probably for Mike Lischke only but if anyone has any idea let me know. Ta

I would like to combine a rotation matrix to do one rotation in one direction then another rotation in another direction. The problem im having is that in Mike's "opener" code, it rotates an object (to translate from .3ds) to a certain position. If I want to rotate it again in a diferent direction is combines the previous rotation and gives me strange results. So I need to do one rotation at the very start (say on the X) then all rotations after that on the Y. Is that impossible?

I found a function called QuaternionMultiply in geomtry.pas which sounds like it should do the trick but I haven't a clue how to use it.

I really hope the above made sense.

Cheers

Woody.

// open the door

Matrix2 := CreateRotationMatrix(MakeA

Matrix := MatrixMultiply(Matrix, Matrix2);

The reason is that RotX, Y, Z are angles not an axis. You could use here three calls like:

// open the door

Matrix2 := CreateRotationMatrix(MakeA

Matrix := MatrixMultiply(Matrix, Matrix2);

etc. or you simply use:

Matrix := Pitch(Matrix, RotX);

Matrix := Turn(Matrix, RotY);

Matrix := Roll(Matrix, RotZ);

Note that this is the kind of Euler angles rotation I talked above which may sometimes not give the requested result. To avoid this you need to use the overloaded variant of these functions and provide a vector (which is usually one of the world axes: [1, 0, 0], [0, 1, 0] and [0, 0, 1]). This is a difference because after the Pitch call the objects up vector no longer is aligned to [0, 1, 0] and turning around this axis is totally different than around the world's "up" vector.

Ciao, Mike