rotate

Started by
4 comments, last by repeat4 17 years, 7 months ago
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"?
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.


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


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!
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?

Anyboby help me? Thank you for read my questions?

This topic is closed to new replies.

Advertisement