Advertisement

Offset in vertex arrays?

Started by March 13, 2003 01:42 PM
3 comments, last by James Trotter 21 years, 11 months ago
I''m using vertex arrays when rendering, and I''m windering if I can use any sort of ''offset'' when using glColorPointer(), and glNormalPointer()?
The glDrawArrays function specifies multiple primitives to render.

void glDrawArrays(
GLenum mode,
GLint first,
GLsizei count
);

Parameters
mode
The kind of primitives to render. The following constants specify acceptable types of primitives: GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON.
first
The starting index in the enabled arrays.
count
The number of indexes to render.
Advertisement
I know what glDrawArrays() does, but I was asking if i could use an offset in ONLY glColorPointer(), and glNormalPointer(), because II don''t want to start at the beginning of the array.
Pass an offset of the address of the data. For example, instead of passing glColorPointer MyColorArray, pass it MyColorArray+3.

Thanks Null and Void, I''ll try it out!

This topic is closed to new replies.

Advertisement