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!
Using D3DXMatrixLookAtLH for billboarding
1 reply to this topic
Crossbones+ - Reputation: 2763
Posted 06 April 2013 - 02:04 PM
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;