#### Archived

This topic is now archived and is closed to further replies.

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

## Recommended Posts

Hmm wrong board for this post, but anyway..

To billboard a quad in D3D it is simple - just set the billboard's world transform matrix to {-U,V,-N} of the camera...

##### Share on other sites
Hi,
code:
SetIdentityMatrix( mat );SetIdentityMatrix( mat1);lpD3Ddevice->GetTransform( D3DTRANSFORMSTATE_VIEW, &mat ); mat._14 = 0; mat._24 = 0; mat._34 = 0; mat._44 = 1;MatrixInvert( mat1, mat ); mat1._41 = position.x; mat1._42 = position.y; mat1._43 = position.z;for(k = 0; k < 4; k++) m_cCoords[ k ].MultiplyWithMatrix( mat1 );

m_cCoords is the array with the coordinates of the quad in local space.

HTH
Greets Tobias

##### Share on other sites
Lance:

"wrong board for this post, but anyway" ?

No, this is the right board for this question. It's specific to D3D.

Tobias:

Thanks !
It's sorta working, but I have a few things that aren't working right. If I can't figure it out, I'll be back

##### Share on other sites
Can anyone give me an example of using the view matrix and drawing billboard'd quad's in D3D ? I can cheat it by just transforming the location of the object and then extending edges in screen space, but I would rather have the quad in local space and transform it to the inverse of the view matrix.

I am mainly getting confused at how I incorporate the Inverse View matrix and the translation and scale of the object.

Any help is greatly appreciated!