#### Archived

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

# DX9 Billboarding

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

## Recommended Posts

Can someone show exactly how to do a simple billboard by combineing the view matrix with the world matrix. I tried doing this in the past and I had a kinda bad result, it binded the stuff to the view matrix. I didn''t really want because I was using rain and when you moved the camera and looked up you could see the rain falling as it fell across the screen top to bottom but think about it your originally facing forward and it looks fine you look up and it still looks the same? I don''t think that looks to good, its raining horizonally. So if anyone could give me a simple example or explaination id be greatful. I just heard you can some how combine the view matrix with the world matrix therefore I wouldn''t have to rotate the objects based on the cameras angles. I just never could figure it out.

##### Share on other sites
I would have thought you would get the same result as what you have already by combining the view matrix and the world matrix.

I think what you really wanna do is have your sprite vertical... and then only rotate around the vertical axis, that should be pretty straight forward... say you have your vertical axis as the z axis...

and you have a camera direction vector of (x, y, z), and your sprite is originally in the x-y plane,

then the angle you need to rotate your sprite by is something like

angle = atan2(y, x);

and the axis of rotation will be (0, 0, 1)...

1. 1
2. 2
frob
15
3. 3
Rutin
12
4. 4
5. 5

• 13
• 12
• 58
• 14
• 15
• ### Forum Statistics

• Total Topics
632124
• Total Posts
3004237

×