
D3D Matrix Problems...
Hello Again
I was having a problem applying matrices. Whenever I try to apply it (WORLD or VIEW), what ever I''m trying to render doesn''t show up. No matter what I try, as long as I''m still appling the transform, it doesn''t show the object. I transform the object like so...
m_pD3DDev->SetTransform(D3DTRANSFORMSTATE_WORLD, &gameship.matLocal );
and then render using...
m_pD3DDev->DrawPrimitive( D3DPT_TRIANGLELIST, D3DFVF_VERTEX, vTriangle, NUM_SHIPFACES, 0 );
but it doesn''t display anything. If I comment the SetTransform line out, it works good.
If anyone can help me with this, I would be very thankful.
Thank you for your time...
-Doddler

What does gameship.matLocal look like? Or rather what matrices do you use to build this matrix?
If you are not careful you might put the ship outside the cameras viewfrustrum.
If you are not careful you might put the ship outside the cameras viewfrustrum.
Um, I''m not really doing anything with the matrix... Basically, the code looks like this...
(Sorry if this code is messy, or inefficient... I was going to do some rotation stuff in there too, but I wanted to get it working first.)
VOID
CGameClass::DoMatrixStuff(ship gameship)
{
D3DMATRIX matWorld;
SetIdentityMatrix(matWorld);
gameship.matLocal = matWorld;
}
If your wondering, SetIdentityMatrix is the same one as in the D3DFramework. Also, If it helps any, I''m using D3DX.
Anyways, thanks for responding...
-Doddler
(Sorry if this code is messy, or inefficient... I was going to do some rotation stuff in there too, but I wanted to get it working first.)
VOID
CGameClass::DoMatrixStuff(ship gameship)
{
D3DMATRIX matWorld;
SetIdentityMatrix(matWorld);
gameship.matLocal = matWorld;
}
If your wondering, SetIdentityMatrix is the same one as in the D3DFramework. Also, If it helps any, I''m using D3DX.
Anyways, thanks for responding...
-Doddler
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement