Original Post
Ive got a simple billboard that rotates towards the camera which is fine - using
D3DXVECTOR3 vDir = game->camera->target - game->camera->origin;
if( vDir.x > 0.0f )
D3DXMatrixRotationZ( &mat, -atanf(vDir.z/vDir.x)+D3DX_PI/2 );
else
D3DXMatrixRotationZ( &mat, -atanf(vDir.z/vDir.x)-D3DX_PI/2 );
It does not however work when in first person as the camera can be rotated around any axis what rotation should I use to ensure that it faces the camera all the time no matter what the roation?
thanks