#### Archived

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

# any tuts on how to use the vertex buffer right??

This topic is 5807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i''m working on learning 3d programming and figured i''d start with dx9 and from what i see it''s not the best choice to learn 3d with but i figure the more work it takes the more i''ll learn. now the hole vertex buffer deal has lost me i understand the whole u have to fill it and then u draw from it but how do u go about figuring out all the vertices(i think thats it) u want with out making a bunch of array''s like they do in the tut''s cause u would easily fill up screen''s of code just for triangles, rectangles ect. and when do u know to use more then one vertex buffer? or if u put a tri and rect into the buffer how do u go about telling it to draw one and not the other? if anyone could direct me to any tuts on vertex buffers the 3d pipe line in any ver of dx or opengl. or any beginner 3d article''s u read to help u learn 3d i''d be greatful or if anyone has any source that sorta deals with the questions i''v asked that''d be great too i hope my question made sense if not just say i''ll try to explain it better

##### Share on other sites
You might want to look at the D3DX shape functions (D3DXCreateBox, D3DXCreateCylinder, etc.). Manually filling a vertex buffer with interesting vertices is a pain and not usually worth the exercise.

When do you use more than one vertex buffer? One good reason is when you have meshes with different vertex formats. One contains texture coordinates, the other doesn''t, that sort of thing. There are a variety of other reasons that you probably don''t need to worry about when you''re first getting started.

To draw different meshes packed into the same VB, use DrawPrimitive''s StartVertex and PrimitiveCount parameters.

##### Share on other sites
You can also use a single vertex buffer and one or more Index Buffers to be choosy about which vertices you want to draw from the vertex buffer.

##### Share on other sites
you normally wouldnt be making the 3d objects by plotting out the vertices.

you would export a 3d model from a 3d modelling program.
the model may contain thousands of vertices.

you would read the vertices from the 3d model file into your d3d program and put them into the vertex buffer.

##### Share on other sites
I wrote a tutorial for Vertex Buffers and submitted it to gamedev about a month ago. Maybe by continuing this thread, they might put it on the "sooner" pile..(but I know what it''s like dealing with submissions, so I ain''t complaining at ALL)..

##### Share on other sites
thx for they reply''s i''m going to try those idea''s using .x modle''s and the D3DXCreateBox.... functions and it would be great if that tut was put up soon

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633679
• Total Posts
3013294
×