   Billboarding in all directions
  Hi, I''m trying to make a billboarding effect in 3D space in all directions. I was looking at the billboarding example given in the DirectX8 SDK, but they only do billboarding around the Y-axis with the following code: if( vDir.x > 0.0f ) D3DXMatrixRotationY( &m_matBillboardMatrix, -atanf(vDir.z/vDir.x)+D3DX_PI/2 ); else D3DXMatrixRotationY( &m_matBillboardMatrix, -atanf(vDir.z/vDir.x)-D3DX_PI/2 ); where vDir is the direction vector of the camera. Can anyone help me with how to rotate the matrix along all three axis simultaneously so the billboarding effect works in all direction in 3D space?? I implemeted a working version already with a transposed view matrix, but for some reason I need to have a working version with the 3 angles version.Thanks. 
  You can calculate all 3 axis (the -atanf(vDir.z/vDir.x)+D3DX_PI/2 part), then call D3DXMatrixRotationYawPitchRoll() with those arguments. ;  You don''t need to play w/ angular functions to get a working (and robust...) billboarding system.Just take your camera matrix, extract the ''up'' and ''right'' vectors (GL code, sorry !):  float m[4][4];glGetFloatv(GL_MODELVIEW_MATRIX,(float*)m);// Take vectors from inverse matrix// (for orthogonal matricies, transpose equals inverse)GLVector right(m[0][0],m[1][0],m[2][0]);right.Normalize3d();GLVector up(m[0][1],m[1][1],m[2][1]);up.Normalize3d();Drawing a quads can then be expressed according to these vectors:glVertex3f(-right.m_X[0]-up.m_X[0] + m_pos.m_X[0],-right.m_X[1]-up.m_X[1] + m_pos.m_X[1],-right.m_X[2]-up.m_X[2] + m_pos.m_X[2]);glVertex3f(right.m_X[0]-up.m_X[0] + m_pos.m_X[0],right.m_X[1]-up.m_X[1] + m_pos.m_X[1],right.m_X[2]-up.m_X[2] + m_pos.m_X[2]);glVertex3f(right.m_X[0]+up.m_X[0] + m_pos.m_X[0],right.m_X[1]+up.m_X[1] + m_pos.m_X[1],right.m_X[2]+up.m_X[2] + m_pos.m_X[2]);glVertex3f(-right.m_X[0]+up.m_X[0] + m_pos.m_X[0],-right.m_X[1]+up.m_X[1] + m_pos.m_X[1],-right.m_X[2]+up.m_X[2] + m_pos.m_X[2]);Note: you need to normalize the up & right vector once per frame.FReD;  yeah, same theory in direct3DD3DXMATRIX billboard;g_device->GetTransform(D3DTS_VIEW, &billboard)billboard._41 = 0.0f;billboard._42 = 0.0f;billboard._43 = 0.0f;D3DXMatrixTranspose(&billboard, &billboard)g_device->SetTransform(D3DTS_WORLD, &billboard) //multiplyed by other matrices//drawing herevery easy  .. I hope I didn''t make a typo though ;  Thx, Lee_ this is as I said the "Transposed Matrix" way, which for some reason I can not use. I need to calculate the rotation axis like the following D3DXVECTOR3 vDir = vLookatPt - vEyePt;float yaw = 0.0f, pitch = 0.0f, roll = 0.0f;if( vDir.x > 0.0f )yaw = -atanf(vDir.z/vDir.x)+D3DX_PI/2;elseyaw = -atanf(vDir.z/vDir.x)-D3DX_PI/2;if( vDir.z > 0.0f )pitch = -atanf(vDir.y/vDir.z)+D3DX_PI/2;elsepitch = -atanf(vDir.y/vDir.z)-D3DX_PI/2;if( vDir.x > 0.0f )roll = -atanf(vDir.y/vDir.x)+D3DX_PI/2;elseroll = -atanf(vDir.y/vDir.x)-D3DX_PI/2;D3DXMatrixRotationYawPitchRoll(&m_matBillboardMatrix, yaw, pitch, roll);Problem, is that only the yaw values seem to be calculated ok, while the pitch and roll values are somehow wrong...Cant anybody help me out here? ;  OK problem is solved thx though 