VolumeJ
Class VJPhongShader

java.lang.Object
  |
  +--VolumeJ.VJShader
        |
        +--VolumeJ.VJPhongShader

public class VJPhongShader
extends VJShader

VJShader implements shading in a Phong illumination model, for ambient and diffuse shading only. Specular refelection has not been implemented. Copyright (c) 2001-2002, Michael Abramoff. All rights reserved.


Fields inherited from class VolumeJ.VJShader
doBackface, light
 
Constructor Summary
VJPhongShader(float ambient, VJLight light, boolean doBackface)
          Create a new shader for ambient light and a VJLight light.
 
Method Summary
 VJShade shade(VJGradient g)
          Shading method for Phong illumination model that uses normalized gradient g.
 java.lang.String toString()
           
 
Methods inherited from class VolumeJ.VJShader
getBackground, getLight, setBackface
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VJPhongShader

public VJPhongShader(float ambient,
                     VJLight light,
                     boolean doBackface)
Create a new shader for ambient light and a VJLight light.
Parameters:
ambient - a float [0-1] that sets the amount of background lighting.
light - a VJLight that is the position and intensity of the diffuse lighting.
doBackface - a boolean that sets whether or not backfacing is on.
Method Detail

shade

public VJShade shade(VJGradient g)
Shading method for Phong illumination model that uses normalized gradient g. Finds the shade that fits with light and g, with ambient and diffuse reflection only. Viewing direction = 0,0,1.
Overrides:
shade in class VJShader
Parameters:
g - a VJGradient containing the normalized gradients in x, y, and z dimensions.
Returns:
a VJShade containing a monocolor or trichannel shade.

toString

public java.lang.String toString()
Overrides:
toString in class VJShader