marchingcubes
Class MCRenderer

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

public class MCRenderer
extends java.lang.Object


Field Summary
static java.awt.Color BKG_COLOR
           
static double DEFAULT_FOCAL
           
static java.awt.Color EDGE_COLOR
           
protected static java.awt.Graphics g
           
static java.awt.Color I_VERTEX_COLOR
           
static int LI_MODL_LAMBERT
           
static int LI_MODL_PHONG
           
protected static java.util.Vector lights
           
protected static int liModl
           
protected static marchingcubes.MCMaterial material
           
static java.awt.Color TEXT_COLOR
           
 
Constructor Summary
MCRenderer()
           
 
Method Summary
static void buildPrMatrix(double r)
          builds the projection matrix
static void clearZBuffer()
          clears the depth buffer; should be called at the beginning of each new frame
static void drawCircle(marchingcubes.MCVector4 center, int size)
          draws a circle in a 3D space
static void drawLine(marchingcubes.MCVector3 v1, marchingcubes.MCVector3 v2)
          draws a line between two points of a 3D space
static void drawString(marchingcubes.MCVector3 p, java.lang.String s)
          draws a string in the 3D space
static void drawTriangleFlat(marchingcubes.MCVector3 v1, marchingcubes.MCVector3 v2, marchingcubes.MCVector3 v3, marchingcubes.MCVector3 n)
          draws a filled triangle using flat shading method
static void setWindow(java.awt.Image img)
          sets the size of the target window used when rendering
static java.awt.Color vertexColor(int w)
          computes the color of a vertex depending on its weight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDGE_COLOR

public static final java.awt.Color EDGE_COLOR

I_VERTEX_COLOR

public static final java.awt.Color I_VERTEX_COLOR

TEXT_COLOR

public static final java.awt.Color TEXT_COLOR

BKG_COLOR

public static final java.awt.Color BKG_COLOR

DEFAULT_FOCAL

public static final double DEFAULT_FOCAL
See Also:
Constant Field Values

LI_MODL_LAMBERT

public static final int LI_MODL_LAMBERT
See Also:
Constant Field Values

LI_MODL_PHONG

public static final int LI_MODL_PHONG
See Also:
Constant Field Values

liModl

protected static int liModl

lights

protected static java.util.Vector lights

material

protected static marchingcubes.MCMaterial material

g

protected static java.awt.Graphics g
Constructor Detail

MCRenderer

public MCRenderer()
Method Detail

buildPrMatrix

public static void buildPrMatrix(double r)
builds the projection matrix

Parameters:
r - focal value

setWindow

public static void setWindow(java.awt.Image img)
sets the size of the target window used when rendering

Parameters:
img - image used for rendering

clearZBuffer

public static void clearZBuffer()
clears the depth buffer; should be called at the beginning of each new frame


vertexColor

public static java.awt.Color vertexColor(int w)
computes the color of a vertex depending on its weight

Parameters:
w - the weight of the vertex
Returns:
the color matching the specified weight

drawString

public static void drawString(marchingcubes.MCVector3 p,
                              java.lang.String s)
draws a string in the 3D space

Parameters:
p - position in the 3D space
s - string to display

drawLine

public static void drawLine(marchingcubes.MCVector3 v1,
                            marchingcubes.MCVector3 v2)
draws a line between two points of a 3D space


drawCircle

public static void drawCircle(marchingcubes.MCVector4 center,
                              int size)
draws a circle in a 3D space

Parameters:
center - center of the circle
size - size of the circle

drawTriangleFlat

public static void drawTriangleFlat(marchingcubes.MCVector3 v1,
                                    marchingcubes.MCVector3 v2,
                                    marchingcubes.MCVector3 v3,
                                    marchingcubes.MCVector3 n)
draws a filled triangle using flat shading method

Parameters:
v1 - first vertex of the triangle
v2 - second vertex of the triangle
v3 - third triangle
n - normal vector to the triangle