• Advertisement
Sign in to follow this  

rotate

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!everyone!I an a student from china.Though my writing English is not very vell! but I really want to communion with all of you and need your help! Maybe Sometimes My expression will not very nicety,Please read my questions take pains! Thank you very much! Next is my question about "rotate"! code list1: D3DXMATRIX matTran; float frads=10; D3DXMatrixRotationY(&matTran,frads); code list2 D3DXMATRIX matTran; float frads=10; D3DXVECTOR3 StaicY(0.0,1.0,0.0); D3DXMatrixRotationAxis(&matTran,&StaticY,frads); question one: code list1 express rotating with the worldCoordinate or the "object's" coordinate? question two: "code list1" is equivalence to "code list2"?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by repeat4
Next is my question about "rotate"!

code list1:

D3DXMATRIX matTran;
float frads=10;
D3DXMatrixRotationY(&matTran,frads);

code list2

D3DXMATRIX matTran;
float frads=10;
D3DXVECTOR3 StaicY(0.0,1.0,0.0);
D3DXMatrixRotationAxis(&matTran,&StaticY,frads);

question one: code list1 express rotating with the worldCoordinate or the "object's" coordinate?

question two: "code list1" is equivalence to "code list2"?


Code list1 just builds a rotation matrix. You can use this matrix to rotate in whichever coodinate space you choose; object or world. To use it with the world you would need something like:

pDirect3DDevice9->SetTransform(D3DTS_WORLD, &matTran);

For question two, yes, the rotation should come out to be equivalent as in code list1.


Share this post


Link to post
Share on other sites
Thank you for you answer!

----------------quote:---------------------------
Code list1 just builds a rotation matrix. You can use this matrix to rotate in whichever coordinate space you choose; object or world. To use it with the world you would need something like:

pDirect3DDevice9->SetTransform(D3DTS_WORLD, &matTran)
-------------------------------------------------------------

As you say,I can use this matrix to rotate in whichever coodinate space I choose
!
pDirect3DDevice9->SetTransform(D3DTS_WORLD, &matTran) this mean rotate in the world coordinate space! but how rotate in the object coordinate space??


Share this post


Link to post
Share on other sites
how rotate in the object coordinate space??

Does the next code work?(that mean :Does the next code will let my object rotate in the object coordinate space??)



code:

D3DXMATRIX matTran;
float frads=10;
D3DXMatrixRotationY(&matTran,frads);
D3DXMatrixMutiply(&matWorld,&matTran,&matWorld);

//the "matWorld" is the World translate matrix of my object!

Share this post


Link to post
Share on other sites
My expreesion is not clear????
if it is that,I am sorry very much!I will try my hard to learn English to
communion with everybody?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement