#### Archived

This topic is now archived and is closed to further replies.

# [java] Display lists and a 3D brain

This topic is 5191 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hi there, I was wondering if someone could help me out... I''m developing an application on Java that loads a 3d brain and allows manipulation on it. the problem is that i use display lists to improve performance and i have to recompile the display list to include any changes in the manipulations. eg wireframe mode. Is there any way to pass any change in the values without having to stop, recompile and display again ? Even when recompiling, i get a message: GLUT: Warning in (unamed): GL error: invalid enumerant Hope to get some light on this!

##### Share on other sites
umm, i forgot to mention that i''m using GL4Java and JDk1.4.2

##### Share on other sites
This is an OpenGL specific issue, you''d got much more answers by posting in the OpenGL forum.

Anyway, since OpenGL is stated based you can set the current state _before_ calling the list.

For example, you could have :
    if(wireframeMode)        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);    else        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);    glCallList(list); //render stuff

So in your display list you put only "render calls" (glBegin / glEnd, glDrawElement,...) and before calling the display list you modify the state (position, materials,...).

##### Share on other sites
Basically the rule is, use display lists (because they''re easy and very efficient) if the object mesh remains static. If you''re simply trying to implement a wireframe mode, by all means use overnhet''s method, but if you want people to transform vertices directly, then you have reached the limitation of display lists. What I would recommend is the equally powerful Vertex Arrays method to draw your mesh.

• 10
• 18
• 14
• 18
• 15