Sign in to follow this  

Loading multiple 3d directX models

This topic is 2844 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

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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

This topic is 2844 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this