• Advertisement
Sign in to follow this  

Building a 3d world

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

hello all i'm trying to build a 3d world. (the player is inside some kind of a "cube" i mean there are 2d squares in the sides, up and etc) but i have a question for each square i have to create a vertex buffer and load it up to the memory? is there another way of doing this? thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Put all the vertices into same index buffer. You then just reference the faces within that buffer.

This explains how it's usually done:
http://www.paradoxalpress.com/Docs/DX9_out/Rendering_from_Vertex_and_Index_Buffers.htm

Share this post


Link to post
Share on other sites
There are a huge number of ways you can construct a 3D world - there are so many variables involved that there isn't really a single Right Way™ of doing it...

If pieces of geometry share the same model space layout then you can easily share the same vertex buffer - just change the world matrix before you render it (e.g. if the same face is used for 4 sides of a cube, just rotate it 90o before each render).

The other possibility is to group related geometry together into a single vertex buffer. Just because you have one vertex buffer doesn't mean you have to have a single draw-call... it's perfectly possible to render small subsets of a VB one or more times - or to completely skip some triangles...

hth
Jack

Share this post


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

  • Advertisement