Sign in to follow this  

How to rotate a billboard towards the camera

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

This topic is 4107 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this