artofillusion.view
Class SmoothVertexShader

java.lang.Object
  extended by artofillusion.view.SmoothVertexShader
All Implemented Interfaces:
VertexShader

public class SmoothVertexShader
extends java.lang.Object
implements VertexShader

This is a VertexShader which renders a uniform colored mesh with smooth shading.


Constructor Summary
SmoothVertexShader(RenderingMesh mesh, Object3D object, double time, Vec3 viewDir)
          Create a SmoothVertexShader for a mesh.
SmoothVertexShader(RenderingMesh mesh, RGBColor color, Vec3 viewDir)
          Create a SmoothVertexShader for a mesh.
 
Method Summary
 void getColor(int face, int vertex, RGBColor color)
          Select the color for a vertex.
 void getTextureSpec(TextureSpec spec)
          Get the color of the surface.
 boolean isUniformFace(int face)
          Get whether a particular face should be rendered with a single uniform color.
 boolean isUniformTexture()
          Get whether this shader represents a uniform texture.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmoothVertexShader

public SmoothVertexShader(RenderingMesh mesh,
                          Object3D object,
                          double time,
                          Vec3 viewDir)
Create a SmoothVertexShader for a mesh.

Parameters:
mesh - the mesh to render
object - the object to which the mesh corresponds
time - the current time
viewDir - the direction from which it is being viewed

SmoothVertexShader

public SmoothVertexShader(RenderingMesh mesh,
                          RGBColor color,
                          Vec3 viewDir)
Create a SmoothVertexShader for a mesh.

Parameters:
mesh - the mesh to render
color - the color in which to draw the mesh
viewDir - the direction from which it is being viewed
Method Detail

getColor

public void getColor(int face,
                     int vertex,
                     RGBColor color)
Select the color for a vertex.

Specified by:
getColor in interface VertexShader
Parameters:
face - the index of the triangle being rendered
vertex - the index of the vertex to color
color - the vertex color will be returned in this object

isUniformFace

public boolean isUniformFace(int face)
Get whether a particular face should be rendered with a single uniform color.

Specified by:
isUniformFace in interface VertexShader
Parameters:
face - the index of the triangle being rendered

isUniformTexture

public boolean isUniformTexture()
Get whether this shader represents a uniform texture. If this returns true, all texture properties are uniform over the entire surface (although different parts may still be colored differently due to lighting).

Specified by:
isUniformTexture in interface VertexShader

getTextureSpec

public void getTextureSpec(TextureSpec spec)
Get the color of the surface. This should only be called if isUniformTexture() returns true.

Specified by:
getTextureSpec in interface VertexShader
Parameters:
spec - the surface color will be returned in this object


Copyright © 1999-2011 by Peter Eastman.