org.proteinshader.gui.viewing
Class Lighting

java.lang.Object
  extended by org.proteinshader.gui.viewing.Lighting

public class Lighting
extends Object

Sets up OpenGL lighting for the Renderer.


Field Summary
static float[] AMBIENT_LIGHT
          The ambient light is { 0.2f, 0.2f, 0.2f, 0.0f }.
static float[] DIFFUSE_LIGHT
          The diffuse light is { 0.95f, 0.95f, 0.95f, 0.0f }.
static float[] LIGHT0_POSITION
          The position of light zero is {200.0f, 200.0f, 200.0f, 1.0f}.
static float[] SPECULAR_LIGHT
          The specular light is { 0.95f, 0.95f, 0.95f, 0.0f }.
 
Constructor Summary
Lighting()
          Constructs a Lighting object.
 
Method Summary
 void disableLighting(GL gl)
          Disables the lighting.
 void enableLightOne(GL gl, float x, float y, float z)
          Light one is set to the xyz-coordinates given as arguments

Light one is a positional light and is intended to be used for specular lighting.
 void enableLightZero(GL gl)
          Light zero is set to the position given in LIGHT0_POSITIONS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIGHT0_POSITION

public static final float[] LIGHT0_POSITION
The position of light zero is {200.0f, 200.0f, 200.0f, 1.0f}. If the last element in the array is zero, then the light is directional. If the last element is non-zero, the light is positional.


AMBIENT_LIGHT

public static final float[] AMBIENT_LIGHT
The ambient light is { 0.2f, 0.2f, 0.2f, 0.0f }.


DIFFUSE_LIGHT

public static final float[] DIFFUSE_LIGHT
The diffuse light is { 0.95f, 0.95f, 0.95f, 0.0f }.


SPECULAR_LIGHT

public static final float[] SPECULAR_LIGHT
The specular light is { 0.95f, 0.95f, 0.95f, 0.0f }.

Constructor Detail

Lighting

public Lighting()
Constructs a Lighting object.

Method Detail

enableLightZero

public void enableLightZero(GL gl)
Light zero is set to the position given in LIGHT0_POSITIONS.

Light zero is a positional light and is intended to be used for specular lighting.

Parameters:
gl - the current GL object.

enableLightOne

public void enableLightOne(GL gl,
                           float x,
                           float y,
                           float z)
Light one is set to the xyz-coordinates given as arguments

Light one is a positional light and is intended to be used for specular lighting.

Parameters:
gl - the current GL object.
x - the x-coordinate for light one.
y - the y-coordinate for light one.
z - the z-coordinate for light one.

disableLighting

public void disableLighting(GL gl)
Disables the lighting.

Parameters:
gl - the current GL object.


Copyright © 2007-2008