Jump to content
  • Advertisement


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

The Lion King

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.

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

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 

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

Share this post

Link to post
Share on other sites
ive had the same problem

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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!