Using D3DXMatrixLookAtLH for billboarding

Started by
0 comments, last by belfegor 11 years ago

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!

Advertisement

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;
 

This topic is closed to new replies.

Advertisement