Jump to content
  • Advertisement


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


multiple meshes (more noob ?s)

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

I finally get how to load a mesh, so I tried loading 2. I got that to work, but theyre intersecting each other. How do I place individual objects in a scene and move them about independently? (for example, have a stationary ground, and a ship (or 20) that flies over it) thanks again, jason

Share this post

Link to post
Share on other sites

I would suggest you read up on using world transformation matrices before going any further if you''re having trouble. Basically, you set the projection transformation once during initialization, set the view transformation once per frame (if it moves), and than for each mesh, set the world transformation, draw a mesh, set next world transformation, draw a mesh, set world... and so on.

To give you your answer in pseudo-code:

For each mesh to draw:
Set mesh''s world transformation matrix
For each material subset in mesh
Set material
Set texture
Draw subset
Next subset
Next mesh

So, basically, a mesh is transformed and rendered using the world transformation currently set. To set any transformation, use the IDirect3DDevice8::SetTransform using D3DTS_WORLD, D3DTS_VIEW, and D3DTS_PROJECTION.

Jim Adams
Author, Programming Role-Playing Games with DirectX

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!