Jump to content
• Advertisement

#### Archived

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

# Billboarding

This topic is 6063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

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

##### Share on other sites
Advertisement
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]?

#### Share this post

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
19
5. 5
• Advertisement

• 14
• 26
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631771
• Total Posts
3002252
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!