May 10 2012 | 1:04 pm

Hi

I am currently trying to create a ModelViewProjection Matrix by "hand" and wanna use the data stored inside the jit.anim.node objects. In the following patch I have an "object" and a "camera" which are beeing each animated, and I take currently with the help of "gettransform" the row-oriented translation matrix from each object.

Now this is obviously not going to work, because the "transform" attribute only stores the local translations of this object, but not the one in the hierarchy above.

First Question:

My guess is, I need to take the values "localtoworld" and "localtoworld_quat" in order to create a model-transformation matrix and "worldtolocal" and "worldtolocal_quat" in order to create a viewing-transformation matrix.

Is this assumption korrect?

I actually tried this but I wasnt successfull, and I cant show the patch here because I use some java-externals to calc the matrices from quad and position.

Second Question:

Is the way I calculate the ModelViewProjection Matrix correct? I know the Sequence of the Matrix Multiplication is relevant, and the here presented example uses the following formula:

P * V * M

according to this thread:
http://www.opengl.org/discussion_boards/showthread.php/169545-column-major-matrix-multiplication?s=931d11d6d0a0308d8e10fde4c1d2381c&p=1193926#post1193926

now the next step would be to multiply this matrix with a vertex, but in the special case where the vertex is (x=0 y=0 z=0 w=1) the resulting Clip-Coordinate has a w-value of zero. thats because the 16th value of the ModelViewProjectionMatrix is zero as well.

The next step would be to divide the Clip-Coordinate through w, but this is now a division though zero and nothing goes anymore. so I assume I made some mistakes, but I simply cannot find it.

I know this is a rather in depth issue because nowadays nobody has to bother with this anymore, openGL takes care of it, but for my problem there is no way around it.

cheers

martin