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

## Recommended Posts

Hello, I'm new to GameDev.Net forum and to game programming in DirectX as well. I have loaded two 3D models using DirectX files. One of the models is a human head and the other one is a mobile phone. I'm having a problem here that when I transform my world by any kind of rotation i.e. rotationX, rotationY, rotationZ, Yaw, Pitch, Roll, etc. both the 3D models rotate on their own axis. I want the mobile phone model to rotate on the same axis as the human head model. Now how can I find the default rotation axis of human head model?? and how to put the same axis of rotation on mobile phone model for any kind of rotation??? Thanks, Ahmed H. CTH - Sweden

##### Share on other sites
The rotation axis is defined by you. If you are just creating a y,p,r matrix then transforming the head and phone by it, the rotation is occuring around the y,x,z axies, in that order. How the head and phone rotate are a result of where the geometry is define in its own coordinate system. If you just got the geometry files from somewhere, you may not know for certain how the geometry is define. You can probably figure it out by watching the geometry rotate.

If what you want to do is have the phone again the head and have it rotate according when the head is moved, you would first apply an offset matrix to the phone, then apply the same rotation as applied the head.

Hope this helps.

##### Share on other sites
Hope I can be helpful, cause I too am still new to this.

To me, it sounds like you are rotating the models and then moving them to their final position.

When you build you transform matrix (building backwards) you multiply your rotation matrices and then your transformation matrix. What this will do is move your model into place and then rotate the model about the origin. Building the matrix in reverse order will rotate the model before it moves the model.

1. 1
Rutin
29
2. 2
3. 3
4. 4
5. 5

• 13
• 13
• 11
• 10
• 13
• ### Forum Statistics

• Total Topics
632959
• Total Posts
3009465
• ### Who's Online (See full list)

There are no registered users currently online

×