marchingcubes
Class MCLight

java.lang.Object
  |
  +--marchingcubes.MCLight

public class MCLight
extends java.lang.Object


Constructor Summary
MCLight(marchingcubes.MCVector3 direction, double ia, double ir, double ig, double ib)
          constructor of a MCLight object
 
Method Summary
static java.awt.Color lambert(marchingcubes.MCVector3 n, java.util.Vector lights, marchingcubes.MCMaterial m)
          computes the color of a face using Lambert lighting model
static java.awt.Color phong(marchingcubes.MCVector3 n, java.util.Vector lights, marchingcubes.MCMaterial m)
          computes the color of a face using Phong lighting model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCLight

public MCLight(marchingcubes.MCVector3 direction,
               double ia,
               double ir,
               double ig,
               double ib)
constructor of a MCLight object

Parameters:
direction - light direction
ia - ambient intensity
ir - red intensity
ig - green intensity
ib - blue intensity
Method Detail

lambert

public static java.awt.Color lambert(marchingcubes.MCVector3 n,
                                     java.util.Vector lights,
                                     marchingcubes.MCMaterial m)
computes the color of a face using Lambert lighting model

Parameters:
n - normal to the face
lights - lights to be taken in account
m - material of the face
Returns:
the color of the face

phong

public static java.awt.Color phong(marchingcubes.MCVector3 n,
                                   java.util.Vector lights,
                                   marchingcubes.MCMaterial m)
computes the color of a face using Phong lighting model

Parameters:
n - normal to the face
lights - lights to be taken in account
m - material of the face
Returns:
the color of the face