Hec
06-13-2000, 10:31 AM
hi http://www.opengl.org/discussion_boards/ubb/smile.gif i have this structures
typedef struct VERTEX {
float xyz[3] ; // x,y,z of the vertex (modified)
float nxyz[3] ; // x,y,z of the vertex (never modified)
float tex[2] ; // 2D texture index
int np ; // number of polygons associated with node
int plist[30] ; // list of polygons associated with node
float norm[3] ; // polygon vertex normal
float anorm[3] ; /* average vertex normal */
} VERTEX ;
typedef struct POLYGON {
VERTEX *vertex[3] ; // pointer to an array of three vertices
} POLYGON ;
and i make this
POLYGON** polygon;
and then i use it like this:
polygon = _new_array(POLYGON *, 500);
polygon[0] = p0;
polygon[1] = p1;
.
.
.
polygon[n] = pn;
but the numbers of polygons is huge, so i'd like to use the vertex array extension, but in the glVertexpointer i need to know the stride thing, how can i calculate the bytes?
please help.
thanks
typedef struct VERTEX {
float xyz[3] ; // x,y,z of the vertex (modified)
float nxyz[3] ; // x,y,z of the vertex (never modified)
float tex[2] ; // 2D texture index
int np ; // number of polygons associated with node
int plist[30] ; // list of polygons associated with node
float norm[3] ; // polygon vertex normal
float anorm[3] ; /* average vertex normal */
} VERTEX ;
typedef struct POLYGON {
VERTEX *vertex[3] ; // pointer to an array of three vertices
} POLYGON ;
and i make this
POLYGON** polygon;
and then i use it like this:
polygon = _new_array(POLYGON *, 500);
polygon[0] = p0;
polygon[1] = p1;
.
.
.
polygon[n] = pn;
but the numbers of polygons is huge, so i'd like to use the vertex array extension, but in the glVertexpointer i need to know the stride thing, how can i calculate the bytes?
please help.
thanks