PDA

View Full Version : Qu abt using display list



wow
01-11-2004, 04:21 AM
Hi, I would like to use display list to draw many triangle, and i have written the following function:

void InitializeList()
{
g_ModelList = glGenLists(1);

if(!glIsList(g_ModelList))
{
MessageBox(NULL, "The display list is not valid", "Error", MB_OK);
return;
}

glNewList(g_ModelList, GL_COMPILE);

glBegin( GL_TRIANGLES );

glVertex3f(1, 1, 0);
glVertex3f(0, 0, 0);
glVertex3f(2, 0, 0);


glEnd();
glEndList();

}


However, I would like to ask if for all the triangle i am going to draw by this function, each triangle vertex are different, will I still be able to use display list? As I don't nkow whether it is flexiable for me to use gltranslate, etc to make the x, y, z coordinate of all the triange in each triangle different...

soconne
01-11-2004, 07:02 AM
Once you create the display, you cannot move any of the vertices 'individually' in your data. but before you 'call' the list, you can use gltranslate and glrotate, but then everything created within the display list will be moved or rotated by that.

orbano
01-11-2004, 07:10 AM
putting one trianlge into a display list is not quite efficient. (hope it was just an example) you should compile whole meshes into a display list.
btw oconnellseanm is right. you can only use static meshes with display lists.