Contents /
Previous /
Next
Using Vertex Arrays: 3 Steps
-
Enable up to six arrays, each to store a different type of data:
- vertex coordinates
- RGBA colors
- color indices
- surface normals
- texture
coordinates
- polygon edge flags.
-
Put data into the array or arrays. The arrays are accessed by the addresses of
(that is, pointers to) their memory locations.
-
Draw geometry with the data. OpenGL obtains the data from all activated arrays
by dereferencing the pointers. There are three ways to do this:
-
Accessing individual array elements (randomly hopping around)
-
Creating a list of individual array elements (methodically hopping around)
-
Processing sequential array elements
Interleaved vertex array data is another common method of organization. Instead
of having up to six different arrays, each maintaining a different type of data
(color, surface normal, coordinate, and so on), you might have the different
types of data mixed into a single array.