Jump to content
  • Advertisement


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


Mesh Position in a 3D world

This topic is 6266 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, I have now loaded in my .x file into my 3d world but the mesh is positioned under neath the ground. So my question is is there a way to specify the position of the mesh on the x, y , z axis? Thanks.

Share this post

Link to post
Share on other sites
Yes there are two ways
#1 When you created your mesh initially in whatever 3d program was the bottom of your mesh located a 0 or positve y values?
This in effect gives you your starting world coords when you place it in D3D

#2 If the answer to number 1 was no then you can either move the meshes coords up untill all y''s are 0-positive values or...you can use the D3DXMatrixTranslation(&matWorld, x,y,z);Device->SetTransform (D3DTS_WORLD, &matWorld); combination to move your mesh any amount in the x,y,z planes depending on what you pass into the translation matrix
Using this matrix does not change the vertex information you have stored in your mesh it is merely a temporary addition or subtraction to the meshes actual vertices
Hope this helps...

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!