Jump to content
  • Advertisement
Sign in to follow this  
fguihen

trying to move one mesh rather than all of them

This topic is 4953 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

ok, i have two classes, a room class that draws a room, and a person class that draws a simple representation of a person. each class contains its own methods to load and draw the meshes. the room mesh is supposed to stay still, and the person is supposed to move through the room. in the draw method for the person, i have the line "device.Transform.world = Matrix.Translation(0,0,value);" this line, which i thought would only move the person along the y axis, seems to move both the room and the person inside the room. i cant find out how to just move the person and keep the room still. any ideas.

Share this post


Link to post
Share on other sites
Advertisement
Did you make sure that you called SetTransform for each mesh?
Since if you only call it once both meshs will move with the matrix, which you set.

Share this post


Link to post
Share on other sites
Setting the device.transform.world in managed directx is equivalent to calling SetTransform in the native d3d.

You need to use somewhat similar pattern to this:

-Begin frame
-Set world tarnsform for the object1's position
-Draw object1
-Set world transform for the object2's position
-Draw object2
-Repeat above for all distinct objects
-End frame

The currently set world matrix affects all geometry drawn after setting it. I think you're missing the point that the world transform can be changed arbitrary amount of times during the scene processing, not (necessarily) just once :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!