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).]
Ok, heres how i work things in OpenGL, i use Vertex Arrays to hold the infromation for drawing my object, then I make a struct for my object, i give it a draw function , and a matrix (m[15]) the matrix hold the positioning data for the object, so in the draw function i just load the objects matrix, the call the functions do draw from the vertex arrays. hope that made sence.
i have a site with some tutorials, home.earthlink.net~/eberkain/
I would reccomend downloading the large .pdf tutorials from nehe.gamedev.net, its only 1500 pages of OpenGL stuff.
I think the best way is to keep data in three arrays:
1)vertex array of 3D vectors
2)normal array of 3D vectors
3)Triangle array of structs
struct {
int p1,p2,p3;
} TTri;
Or data about tri_strips.