Skip to main content
GameDev.net gamedev.net
🔒 Locked

Why dosen't my SetTransform work?

Started by Optimal Jan 5, 2003 at 3:23 PM 4 replies 400+ views
Original Post
Optimal
Optimal
I have never had problems with it before. But now suddenly the changes that I make using it won''t apply. This is the code I use: D3DXMatrixIdentity( &Identy ); D3DXMatrixMultiply(&matWorld,&matWorld,&Identy); D3DXMatrixRotationY( &matWorld, timeGetTime()/150.0f ); m_pDevice->SetTransform( D3DTS_WORLD, &matWorld ); And I want the transformation to affect this rendering: m_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 1, (void*)vertices, sizeof CUSTOMVERTEX); That I call directly after I have Set the transformation. Is there something Iam missing. Or is there something that can cancel out the SetTransform? The problem is that the damn triangle won''t rotate. Hope someone can help me out
True to the source..
S1CA
S1CA
And your FVF? - it is set, it doesn''t contain D3DFVF_XYZRHW.

Have you tried taking out the timeGetTime and instead just incrementing a static variable ?

And I don''t quite get what you''re trying to achieve either:

// This won''t do _anything_ - (M*I=M)
D3DXMatrixIdentity( &Identy );
D3DXMatrixMultiply(&matWorld,&matWorld,&Identy);

1x500

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
trekey19966
trekey19966
m_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 1, (void*)vertices, sizeof CUSTOMVERTEX);

should be

m_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, 1, (void*)vertices, sizeof(CUSTOMVERTEX));



David Smith
www.geocities.com/gamespp5004
-"If you can''t dream it; it can''t be done"-David Smith

David Smithwww.geocities.com/gamespp5004-"If you can't dream it; it can't be done"-David Smith
Optimal
Optimal
he he, some of that was the wrong code :
D3DXMatrixIdentity( &Identy );
D3DXMatrixMultiply(&matWorld,&matWorld,&Identy);

This was used testing something else but I did unfortunately copy it with the other code.

What Iam trying to do is to rotate the triangle in this case. Using the SetTransform and in this case transfrom the world matrix. So that the object spins.

And the problem is like I said before I dosen't seem to be used by the rendering. There is no change if I use settransform or not. The result is the same.

So please help. I have used this before but now it suddenly became a problem.

Is there anything special requered to use settransform?

Guess directx ain't my deal

[edited by - Optimal on January 5, 2003 10:27:00 PM]
True to the source..
luxitan
luxitan
first of all i''m kinda new to this 3d stuff so don''t expect much

have you tried this:

D3DXMATRIX matTemp;

D3DXMatrixRotationY( &matTemp, timeGetTime()/150.0f );
D3DXMatrixMultiply(&matWorld,&matWorld,&matTemp);
m_pDevice->SetTransform( D3DTS_WORLD, &matWorld );


don''t know if it works but give it a try
To be considered a genius you just have to say what everybody knows in a way very few understand

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.