#### Archived

This topic is now archived and is closed to further replies.

# Rotation in Direct3D 9

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

## Recommended Posts

Hi, Rotation is something that is very easy to understand, but it is giving me a really big headick now. My problem is When I rotate on X or Y Axis by using D3DXMatrixRotationX() or Y() it rotated around the screen not at a point. Rotating on Z rotates it on the point. I have coded before but now things are getting a bit messy. When ever I use the code that I use for Translation of Objects, then these things happen. Everything seems to be fine. It also happened when I was coding in OpenGL a month back. But I accomplished this task using Push and Pop Stack Layers. Is there anything like this in Direct3D9? The code is fine ...
D3DXMATRIXA16 World; // World CoOrdinates
float Angle = 0.0f;  // Angle of Rotation

D3DXMatrixRotationY (&World, Angle); // Set Rotation on Y-Axis
D3DDevice->SetTransform (D3DTS_WORLD, &World); // Transform

Angle += 0.05f; // Increment in Angle
[\CODE]

Please help !!!   
I can survive anything ... even NUKES!!! The Lion King

##### Share on other sites

what you have to do is when initialising your vertex values at the start,

make sure about the middle of all the points are at the origin,

i think u can find that with an average of all the vertexs and move them at bit if you want to get a bit technical

same with meshes , when creating move them to the most on origin

otherwise it rotates the objects around the origin of their original points

1. 1
2. 2
Rutin
19
3. 3
khawk
19
4. 4
5. 5
A4L
11

• 9
• 12
• 16
• 26
• 10
• ### Forum Statistics

• Total Topics
633771
• Total Posts
3013763
×