Sign in to follow this  
mc30900

Building a 3d world

Recommended Posts

mc30900    100
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
Antheus    2409
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
jollyjeffers    1570
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this