Archived

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

anidex

Model Location/Position

Recommended Posts

anidex    122
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
Guest Anonymous Poster   
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
Xgkkp    122
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