Skip to main content
GameDev.net gamedev.net
🔒 Locked

Billboarding

Started by tSG Dec 13, 2001 at 3:39 PM 3 replies 350+ views
Original Post
tSG
tSG
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 --
-- tSG --
miles vignol
miles vignol
I would think it''s the same way, but I don''t know DX. Might it be the matrix order is reversed? matrix[column][row] vs matrix[row][column]?
Digicube
Digicube
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.
tSG
tSG
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 --
-- tSG --
tSG
tSG
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 --
-- tSG --

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.