• Advertisement
Sign in to follow this  

Removing roll from billboard matrix

This topic is 4792 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I've got a little problem with creating the billboard matrix that faces the camera all the time, but doesn't roll with the camera. Objects like tree or some kind of pole are going horizontal when the camera is rolling. Anyway, I still need the 'yaw' so I don't want it to be like in D3D SDK billboard sample. I'd be very grateful if someone could help me removing the rolling from the billboard matrix. My current billboard transformation is generated like this: D3DXMATRIX mBillboard; D3DXMATRIX mView; pDevice->GetTransform(D3DTS_VIEW, &mView); D3DXMatrixInverse( &mBillboard, NULL, &mView ); mBillboard._41 = 0.0f; mBillboard._42 = 0.0f; mBillboard._43 = 0.0f; D3DXMATRIX mScale; D3DXMatrixScaling(&mScale, 20.0f, 20.0f, 20.0f); D3DXMatrixMultiply(&m_mTransform, &mBillboard, &mScale); m_mTransform._41 = m_vTranslation.x; m_mTransform._42 = m_vTranslation.y; m_mTransform._43 = m_vTranslation.z; Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Or if not removing the rolling from the matrix, I'd need help with the generation of matrix that billboard faces the camera with yaw/pitch, but without roll.

Share this post


Link to post
Share on other sites
here is a article
http://www.mvps.org/directx/articles/view_oriented_billboards.htm
I think it will help you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement