Jump to content
  • Advertisement
Sign in to follow this  

How to make billboards ?

This topic is 3216 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

Hi guys, I've been combing the internet for hours and found (as usual) nothing useful. I want to do billboards with c++ and dx9. The reason I chose billboards over point sprites is that I want to rotate them and I heard thats not that easy possible with them and they are just generally to unflexible. Anyway, I managed to display a bunch of objects but now I want to display billboards for some special effects. For that I made a square out of 2 triangles that I display a texture on which works pretty good, but of course I cannot apply my usual matrices because when the camera position moves I look on the billboard from a different angle until it disappears (backface, etc...). The point of the billboard is that its always facing the camera and that is where my problems start. The way I take it I have to rotate every billboard according to the angle it is regarding to the camera, right ? Or is it enough to simply rotate all billboards that they are parallel to the viewing plane ? I am not really sure and would appreciate any help with this, especially as to how I create a new view matrix/matrices for the billboards.

Share this post

Link to post
Share on other sites
Hi, thanks alot for your reply.

I read your link but unfortunately I don't really understand how to implement it. I created a matrix from the view matrix like you mentioned there which looks like this:

matBillBoard._11 = matView._11;
matBillBoard._12 = matView._21;
matBillBoard._13 = matView._31;
matBillBoard._14 = x;

matBillBoard._21 = matView._12;
matBillBoard._22 = matView._22;
matBillBoard._23 = matView._32;
matBillBoard._24 = y;

matBillBoard._31 = matView._13;
matBillBoard._32 = matView._23;
matBillBoard._33 = matView._33;
matBillBoard._34 = z;

matBillBoard._41 = 0;
matBillBoard._42 = 0;
matBillBoard._43 = 0;
matBillBoard._44 = 1;

I have now 3 questions to this.

1. Is this correct ?

2. what exactly is x,y,z ? I tried putting there some values but to no avail.

3. How do I exactly apply this matrix ?
My usual way of applying matrices is like this:

object->matObject * matWorld * matView * matProj;

How does this new matrix fit into there ?

Thanks in advance...


[Edited by - Zaph-0 on December 27, 2009 6:00:33 PM]

Share this post

Link to post
Share on other sites
Ah, it seems I got it working, but I found a few things a little strange so I'm not sure what to make of this.

1. Instead of using the position x,y,z at m.14, m.24, m.34 they are at m.41, m.42, m.43.
2. The billboard is being displayed clockwise and must be created that way.

Ah well it works, thats all that matters for now...


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

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!