View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1Anonymous Poster_Anonymous Poster_*  Guests

Posted 07 December 1999 - 06:31 PM

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!

### #2Anonymous Poster_Anonymous Poster_*  Guests

Posted 07 December 1999 - 05:44 AM

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...

### #3Ake  Members

Posted 07 December 1999 - 06:06 AM

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

### #4Anonymous Poster_Anonymous Poster_*  Guests

Posted 07 December 1999 - 06:31 PM

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

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.