|
-
Jul 15th, 2003, 02:51 AM
#1
Thread Starter
Member
D3DX, rotating object on both z and y axis?
Hey I'm trying to spin my object on both y and z axis.
Like I don't care what axis i am rotating my object, im just trying to rotate 2 axis's at a time.
this is the code that rotates on a z axis.
D3DXMATRIXA16 matWorld;
D3DXMatrixRotationZ( &matWorld, fAngle );
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
But how do i get it to rotate on both z and y, i tried the code below but it only rotates on the x axis.
D3DXMATRIXA16 matWorld;
D3DXMatrixRotationZ( &matWorld, fAngle );
D3DXMatrixRotationX( &matWorld, fAngle );
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
Whats wrong?
i just realised i spelt my name wrong....
-
Jul 15th, 2003, 05:42 AM
#2
The Rotation function builds a rotation matrix, overriding whatever is in the matrix at the moment. So:
Code:
D3DXMATRIXA16 matWorld, temp;
D3DXMatrixRotationZ( &matWorld, fAngle );
D3DXMatrixRotationX( &temp, fAngle );
D3DXMatrixMultiply(&matWorld, &matWorld, &temp);
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|