colors in display lists? (OpenGL)
in
Core Library Questions
•
3 years ago
Hi, I'm trying to use a display list to draw a set of axes in 3D, the code for the display list is below, but for some reason the colors aren't showing up (everything is gray) - I needed the x, y, and z axes to be red, green, and blue respectively. Any ideas as to why these colors aren't rendering?
Thanks!
Thanks!
- void createAxesList(){
- if(!(boolean)gl.glIsEnabled(gl.GL_NORMALIZE)) gl.glEnable(gl.GL_NORMALIZE){
- axesList = gl.glGenLists(1);
- gl.glNewList(axesList, gl.GL_COMPILE);
//x axis
gl.glColor3f(1.0f, 0.0f, 0.0f);
gl.glBegin(gl.GL_LINES);
gl.glVertex3f(0.0f, 0.0f, 0.0f);
gl.glVertex3f(80.0f, 0.0f, 0.0f);
gl.glEnd();
//y axis
gl.glColor3f(0.0f, 1.0f, 0.0f);
gl.glBegin(gl.GL_LINES);
gl.glVertex3f(0.0f, 0.0f, 0.0f);
gl.glVertex3f(0.0f, 80.0f, 0.0f);
gl.glEnd();
//z axis
gl.glColor3f(0.0f, 0.0f, 1.0f);
gl.glBegin(gl.GL_LINES);
gl.glVertex3f(0.0f, 0.0f, 0.0f);
gl.glVertex3f(0.0f, 0.0f,80.0f);
gl.glEnd();
gl.glEndList();
}