Class Material

java.lang.Object
  |
  +--Material

public class Material
extends java.lang.Object

Material describes the surface properties of an object using ambient, diffuse and specular components.


Field Summary
 Colour Ambient
          Holds the ambient component of this surface
 Colour Diffuse
          Holds the ambient component of this surface
 double Shininess
          Holds the shininess factor this surface
 Colour Specular
          Holds the specular component of this surface
 
Constructor Summary
Material()
          Create a default material
Material(Material m)
          Create a new material by copying an existing material.
 
Method Summary
 void print(SceneWriter os)
          Print a human readable version of the material definition to the given destination
 void read(SceneReader is)
          Read the material from the given source
 void write(SceneWriter os)
          Write the material to the given destination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Ambient

public Colour Ambient
Holds the ambient component of this surface

Diffuse

public Colour Diffuse
Holds the ambient component of this surface

Specular

public Colour Specular
Holds the specular component of this surface

Shininess

public double Shininess
Holds the shininess factor this surface
Constructor Detail

Material

public Material()
Create a default material

Material

public Material(Material m)
Create a new material by copying an existing material.
Parameters:
m - the material to copy
Method Detail

read

public void read(SceneReader is)
          throws java.io.IOException,
                 java.lang.NumberFormatException
Read the material from the given source
Parameters:
is - the source to read from
Throws:
java.io.IOException - if the light can not be read
java.io.NumberFormatException - if there a number format error is encountered

write

public void write(SceneWriter os)
           throws java.io.IOException
Write the material to the given destination
Parameters:
os - the destination to write to
Throws:
java.io.IOException - if the write fails.

print

public void print(SceneWriter os)
           throws java.io.IOException
Print a human readable version of the material definition to the given destination
Parameters:
os - the destination to write to
Throws:
java.io.IOException - if the write fails.