Archived

This topic is now archived and is closed to further replies.

tSG

Billboarding

Recommended Posts

tSG    122
How could I calculate a billboarding matrix from the viewing matrix in opengl? I have made it in directx but it just doesn''t work in ogl and I can''t solve the problem. Thx in advance -- tSG --

Share this post


Link to post
Share on other sites
Digicube    122
The OpenGL matrix is of the following:

01 05 09 13
02 06 10 14
03 07 11 15
04 08 12 16

To do billboarding you would take the transpose of the rotation matrix,

01 05 09
02 06 10
03 07 11

becomes

01 02 03
05 06 07
09 10 11

make sure you keep the other positions in the matrix as they were, 04,08,12,16,13,14,15. Then just Load the new matrix.

Share this post


Link to post
Share on other sites
tSG    122
quote:
Original post by Digicube
To do billboarding you would take the transpose of the rotation matrix,

01 05 09
02 06 10
03 07 11

becomes

01 02 03
05 06 07
09 10 11

make sure you keep the other positions in the matrix as they were, 04,08,12,16,13,14,15. Then just Load the new matrix.



Thanks for the help, but it doesn''t work for me. Is that all?
Btw. I could make something but it is a bit strange. I don''t know wheather good: I simply make the rotation matrix to identity and leave the others as they were. Is this a good idea or just a lucky that it works?

miles: I know that opengl matrix is the transpose of dx matrix, so it can''t be a problem


-- tSG --

Share this post


Link to post
Share on other sites
tSG    122
There was yet an another problem, but it seem that I could solve it. Please tell me your opinion!
Now I get the invert matrix, clear the translate-part then
multiply it with the translation matrix generated from the position-vector of the billboard. After that I multiply this matrix with the view-matrix.
Opinions?


-- tSG --

Share this post


Link to post
Share on other sites