Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Billboard D3D Quad


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.

  • You cannot reply to this topic
3 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

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!


Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

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



#3 Ake   Members   -  Reputation: 122

Like
Likes
Like

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


#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

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.



PARTNERS