Sign in to follow this  

Using D3DXMatrixLookAtLH for billboarding

Recommended Posts

george7378    1441

Is it possible to create a look-at matrix to force an object to always face the camera? At the moment I'm having to rotate my billboard plane in 3 dimensions using dot products and matrices to find angles, etc... but it would be nicer if I could use a matrix like this to do it for me. Is it possible? Thanks!

Share this post

Link to post
Share on other sites
belfegor    2834

Just use inverse of view matrix and alter position of a billboard

D3DXMatrixInverse(&billboardWorldMat, NULL, &camViewMat);
billboardWorldMat._41 = myBillboardX;
billboardWorldMat._42 = myBillboardY;
billboardWorldMat._43 = myBillboardZ;

Share this post

Link to post
Share on other sites

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