Skip to main content
gamedev.net
🔒 Locked

Model Location/Position

Started by anidex 1 reply 150+ views
Original Post
anidex
anidex
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
Xgkkp
Xgkkp
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.