Skip to main content
gamedev.net
🔒 Locked

move an object

Started by javincin Jun 10, 2004 at 10:32 AM 4 replies 250+ views
Original Post
javincin
javincin
who can i move a mesh across mi world? i can move the camera, rotate and translate my world, but i don''t know move a mesh. What''s the function? Thanks.
acw83
acw83
Where to begin...

Each "object" of yours probably has an associated location in world space, ie and x, y, and z, coordinate. You translate each object mesh by these coordinates when you render then so that they appear in the proper scene location. So to move your objects you just adjust the x, y, z coordinates of your object. However, it is a bit more complicated because depending on how your object is oriented, concepts like "forward" and "up" are relative. Try the GameDev search function for help.
Sr_Guapo
Sr_Guapo
Assign a different world matrix to every mesh you need, then just set each matrix before you render that particular object...
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
javincin
javincin
I read the post of hammer_bg_, but i don't understand anything. I'm just a program in visual basic, and i can't use the examples of those post. If anybody knows those examples in VB, please write it.

[edited by - javincin on June 10, 2004 11:54:25 AM]
Sr_Guapo
Sr_Guapo
I use VB... Anyway, create a new matrix for your 3D mesh/object. When the mesh needs to be transformed, transform theat matrix. Right before rendering the object set the matrix using (in DX9):

D3DDevice.SetTransform(TransformType.World, matObject)

where D3DDevice is your devbice, and matObject is the matrix for the object.
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
javincin
javincin
Ok, i''m going understanding. When I had only an object and a worldMatrix, that runs ok, but now i have 2 object and 2 worldmatrix. Who i assing the objects to the matrices??? Thanks.

Topic Locked

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

Sign in to reply to this topic.