Original Post
🔒 Locked
move an object
Advertisement
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.
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.
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.
D3DDevice.SetTransform(TransformType.World, matObject)
where D3DDevice is your devbice, and matObject is the matrix for the object.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement