viewer
Class Lights

java.lang.Object
  extended by viewer.Lights

public class Lights
extends java.lang.Object


Constructor Summary
Lights(GLViewer glViewer, javax.media.opengl.GL gl)
          Initializes light arrays and GL enviroment
 
Method Summary
 void adjustDiffuse(int b)
          Adjusts light_diffuse array up or down by b%
 void init()
          Sets lights to inital values (hard-coded)
 void lightAmbient(float r, float g, float b, float a)
          Sets light_ambient to specified values.
 void lightDiffuse(float r, float g, float b, float a)
          Sets light_diffuse to specified values.
 void lightSpec(float r, float g, float b, float a)
          Sets light_spec to specified values.
 void matsEmission(float r, float g, float b, float a)
          Sets mat_emission to specified values.
 void matsShine(float s)
          Sets mat_shininess to specified values.
 void matsSpec(float r, float g, float b, float a)
          Sets mat_specular to specified values.
 void moveLight(float x, float y, float z, float a)
          Sets light_position to specified values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lights

public Lights(GLViewer glViewer,
              javax.media.opengl.GL gl)
Initializes light arrays and GL enviroment

Parameters:
glViewer -
gl -
Method Detail

init

public void init()
Sets lights to inital values (hard-coded)


moveLight

public void moveLight(float x,
                      float y,
                      float z,
                      float a)
Sets light_position to specified values. Must still call glLightfv in an open GL context with respect to light you want changed to acaully change light

Parameters:
x -
y -
z -
a -

lightDiffuse

public void lightDiffuse(float r,
                         float g,
                         float b,
                         float a)
Sets light_diffuse to specified values. Must still call glLightfv in an open GL context with respect to light you want changed to acaully change light

Parameters:
r -
g -
b -
a -

lightAmbient

public void lightAmbient(float r,
                         float g,
                         float b,
                         float a)
Sets light_ambient to specified values. Must still call glLightfv in an open GL context with respect to light you want changed to acaully change light

Parameters:
r -
g -
b -
a -

lightSpec

public void lightSpec(float r,
                      float g,
                      float b,
                      float a)
Sets light_spec to specified values. Must still call glLightfv in an open GL context with respect to light you want changed to acaully change light

Parameters:
r -
g -
b -
a -

matsSpec

public void matsSpec(float r,
                     float g,
                     float b,
                     float a)
Sets mat_specular to specified values. Must still call glMaterialfv in an open GL context to acually change material properties

Parameters:
r -
g -
b -
a -

matsEmission

public void matsEmission(float r,
                         float g,
                         float b,
                         float a)
Sets mat_emission to specified values. Must still call glMaterialfv in an open GL context to acually change material properties

Parameters:
r -
g -
b -
a -

matsShine

public void matsShine(float s)
Sets mat_shininess to specified values. Must still call glMaterialfv in an open GL context to acually change material properties

Parameters:
s -

adjustDiffuse

public void adjustDiffuse(int b)
Adjusts light_diffuse array up or down by b%

Parameters:
b -