Login  Register

Re: LIGHTING On the Earth model

Posted by gouessej on Dec 04, 2014; 6:09pm
URL: https://forum.jogamp.org/LIGHTING-On-the-Earth-model-tp4033709p4033711.html

Hi

Which kind of lighting do you want to put on your Earth model?

You have to call glNormal3f for each vertex to pass the normal, use glShadeModel to choose your shading model, call GL2.glEnable(GL2.GL_LIGHTING), call glLight to set the light parameters and glEnable(GL2.GL_LIGHT1) to enable the first light for example. If you don't know these methods, look at the OpenGL SDK documentation.

It's possible to implement it with shaders but it's harder.

By the way, you should switch to vertex arrays or VBOs instead of using immediate mode (glBegin/glEnd, ...).

Look at jogl-demos on Github if you need some examples. Good luck.
Julien Gouesse | Personal blog | Website