Hello!
I have two questions. The first one is about lights, I do the following to enable lighting:
// Setting light
float[] lightPos = {(float)cameraFromX, (float)cameraFromY, (float)cameraFromZ, 1};
float[] lightAmbient = {0.1f, 0.1f, 0.1f, 1.0f};
float[] lightDiffuse = {1.0f, 1.0f, 1.0f, 1.0f};
// Set light parameters.
gl.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, lightAmbient, 0);
gl.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, lightDiffuse, 0);
gl.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION, lightPos, 0);
gl.glEnable(GL.GL_LIGHT1);
gl.glEnable(GL.GL_LIGHTING);
Now when I draw something, I cant change the color using glColor3f, everything turns into white color! I am using GL_LINES and GL_QUADS.
About the anti-aliasing, I draw a 2D rectangle:
gl.glBegin(GL.GL_QUADS);
gl.glNormal3f( 0.0f, 0.0f, 1.0f);
gl.glVertex3d(-data.width / 2, -data.height / 2, 0);
gl.glVertex3d(data.width / 2, -data.height / 2, 0);
gl.glVertex3d(data.width / 2, data.height / 2, 0);
gl.glVertex3d(-data.width / 2, data.height / 2, 0);
gl.glEnd();
And I use for anti-aliasing, on the init method:
gl.glEnable(GL.GL_LINE_SMOOTH);
gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
I change the camera angle, using gluLookAt and this is the result, I dont think it is much anti-aliased
I have another question, with glu functions I can draw a sphere easily, isnt there a half-sphere method?
Thank you!