Jump to content
  • Advertisement
Sign in to follow this  
LE

How to rotate a billboard towards the camera

This topic is 4357 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 I have a vertex stream that looks like this Pos, texture, WidthHeight, color Constants InvView, View, Projection Now my problem is to solve this all with a nicely rotated billboard This far Pos = Pos + InvView.pos direction = Pos - View; Now how do I apply this direction to the rotation of the vertex? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
The three most common types of billboards that I'm aware of are viewplane aligned, viewpoint aligned, and axial aligned (trees, laser beams).

The first is the easiest to construct a matrix for, as it's just the position along with the camera orientation flipped about the up axis. The second can be constructed with a few cross products using an 'aim at' matrix (what's sometimes called an 'inverse look at'). The third is similar to the second but the axes are treated differently with the result that the billboard is contrained to a particular axis.

Which of these did you have in mind? Also, what's the target API? (That is, where is the matrix going...)

Share this post


Link to post
Share on other sites
Well actually there is no matrix involved. There is only position of the vertices that are sent to the shader.

But the desired effect is to have the billboards always face the viewer.

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!