Rottbott

06-21-2001, 01:46 PM

Hi,

I've just started OpenGL, I've got no books so I'm working entirely from the web. Tricky but I'm making some progress.

What I need to do is think of the best way to hold vertex positions. Currently I use a simple structure:

#define MAX_POLYGONS 50

// Polygon vertex position structure

struct

{

float VertexX[3], VertexY[3], VertexZ[3];

} Poly[MAX_POLYGONS];

However, this takes up all the memory straight away (MAX_POLYONS). Also I need to seperate the vertexes for each object.

So what I need is a sensible way of storing information for each object, which can also store vertex position data for any number of polygons. It doesn't matter if each polygon is limited to an exact number of vertexes (I will probably stick to GL_TRIANGLES for now).

Any ideas?

Thanks.

[This message has been edited by Rottbott (edited 06-21-2001).]

I've just started OpenGL, I've got no books so I'm working entirely from the web. Tricky but I'm making some progress.

What I need to do is think of the best way to hold vertex positions. Currently I use a simple structure:

#define MAX_POLYGONS 50

// Polygon vertex position structure

struct

{

float VertexX[3], VertexY[3], VertexZ[3];

} Poly[MAX_POLYGONS];

However, this takes up all the memory straight away (MAX_POLYONS). Also I need to seperate the vertexes for each object.

So what I need is a sensible way of storing information for each object, which can also store vertex position data for any number of polygons. It doesn't matter if each polygon is limited to an exact number of vertexes (I will probably stick to GL_TRIANGLES for now).

Any ideas?

Thanks.

[This message has been edited by Rottbott (edited 06-21-2001).]