Archived

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

Rad76

Mesh Position in a 3D world

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