Archived

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

baddrizz

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

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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
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 this post


Link to post
Share on other sites