Jump to content
  • Advertisement

Archived

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

anidex

Model Location/Position

This topic is 5859 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 folks, I have a little problem. It may seem small, but even after going through the entire Help file twice, I didn''t find a solution. How can I find the location of a model that I have loaded into the seen. For eg, when you create light you can just say, light.Position.x = ...., but how do I access a meshes coordinates and then how can I update it, to move the mesh. Thanks, Anirudh

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You have to set the world matrix to transform your model from local space.

Share this post


Link to post
Share on other sites
Triple Posts!!!

When you render a mesh you set the world transform to define the position the mesh is drawn in when you pass it to DrawPrimitive.

To move the mesh, you just set a different World Transform.

All meshes (most) will have there own, local co-ordinates. e.g. a box might have it''s vertices relative to the center of it''s volume, then have a world matrix that moves it along an x axis.

Think of it like this (This is not how it is done, to my knowledge) - By setting the world matrix to 5 along the X axis, you are effectively moving the whole world -5 along the x-Axis and drawing the box so it''s 0 is the world 0.

It''s not a great Explanation, but it makes sense to me.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!