# rotate

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

## 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 on other sites
Quote:
 Original post by repeat4Next 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 on other sites

----------------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 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;
D3DXMatrixMutiply(&matWorld,&matTran,&matWorld);

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

##### 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 on other sites
Anyboby help me? Thank you for read my questions?

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 9
• 23
• 20
• 14
• 14
• ### Forum Statistics

• Total Topics
633383
• Total Posts
3011586
• ### Who's Online (See full list)

There are no registered users currently online

×