Advertisement

Vertex Buffers in D3D

Started by September 09, 1999 06:11 PM
2 comments, last by Shinkage 25 years, 4 months ago
The simple example provided in the DirectX help file doesn't seem terribly complicated to me.

DirectX Foundation/Direct3D Immediate Mode Essentials/Vertex Buffers/Using Vertex Buffers

It provides you with a short little piece of example code to get a vertex buffer created and then shows you how to access its memory and then render it to the screen. Do you have any more specific question about how to use them?

Ack. I really meant Indexed primitives vertex buffer or no. My mind was just on vertex buffers at the time. Eep.

I don't quite "get" how one is supposed to setup the indices for indexed primitives. That is what I need help with.

It's shown in a fairly simple manner how to set it up in a few of the demos but I don't understand indexing itself, so I cant do it on my own.

Thanks man.

Advertisement
Vertex buffers in D3D have totally kicked my ass. The example app is completely Greek to me. Does anyone know of any resources where I can learn to use them?

(or a simple app w/ source?)

The idea behind indexed primitives is that the polygon data is actually separate from the vertex data (as opposed to a list of vertices defining a strip of polygons or something similar). It's really quite simple to implement. First, you have to store an array of all the vertices that are used in your model. Now the index part comes in when you are defining the polygons that use that list of vertices. To do so, you store a separate array of integers that are indices into your array of vertices. The obvious advantage to this is that you only have to pass each vertex through the renderer once, even though it may be referenced by multiple polygons.
[quote name='Shinkage' timestamp='936900660' post='1008245']
The idea behind indexed primitives is that the polygon data is actually separate from the vertex data (as opposed to a list of vertices defining a strip of polygons or something similar). It's really quite simple to implement. First, you have to store an array of all the vertices that are used in your model. Now the index part comes in when you are defining the polygons that use that list of vertices. To do so, you store a separate array of integers that are indices into your array of vertices. The obvious advantage to this is that you only have to pass each vertex through the renderer once, even though it may be referenced by multiple polygons.
[/quote]
[color=#333333][font=arial, sans-serif][size=2]Rightly said, I agree with you, thank you share, I wish you good luck![/size][/font][/color]

This topic is closed to new replies.

Advertisement