i just want to, if we could change the object that we’ve already built and shown on the viewer interactively, i mean may be we could change the color with press the keyboard or the mouse, but without rebuild the object from the scracth
May be we could use glList or something ??
You can build an object in a displaylist without Materials (colors) and set up a current color before calling the list. BUT you can only change the first color. As soon as you have a colordefinition in the displaylist the setting from outside the list isn’t used any longer.
but can i changing the vertex from my mesh object
If you want to edit a vertex, don’t use call lists or display lists.
Instead keep your mesh in your own data structure. Then when you edit a vertex, ‘re-paint’ its connected triangles with glBegin, glVertex, glEnd, etc. (You may have to blank the 2d area first.)
In simple commands, OpenGL isn’t saving your 3d shape in memory. It just remembers the 2d color/depth pixels.
As one guy told me, just understand that this is a big pipe!
You can’t change the geometry of a display list, but I think you can change the colors using an extension to openGL called paletted texture extension. Altough I’ve never used this extension with display lists if I understand how displaylists work in the opengl pipeline you should still be able to used this extenion to change colors. This would be super fast. Basically the way it works would be you assign each vertex a number for the color and then in a table off somewhere else that number refers to a color. So if you change the color the number refers to in the table, it changes the vertex color.