|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Triangle
A triangle in 3D, with three Vec vertices and a reflectivity (a Color). A triangle is represented by the Vec objects of its three vertices. A triangle has a color associated with it, for filling, illumination, etc.
For CSU540 Computer Graphics class, Spring 2005 CCIS, Northeastern University
Includes linear transform using a Mat
Method names ending with "Same" alter the given triangle.
Others return a copy.
Field Summary | |
java.awt.Color |
color
Color, for filling, illumination, etc. |
Vec |
normal
The unit outward normal |
Vec[] |
tri
The three vertices |
Constructor Summary | |
Triangle()
Creates black Triangle with the 3-element Vec array. |
|
Triangle(Vec v0,
Vec v1,
Vec v2,
java.awt.Color c)
Creates colored Triangle with the three given vertices |
Method Summary | |
void |
drawTri(java.awt.Graphics g)
Creates and closes a GeneralPath for the triangle, sets the color and fills it. |
static void |
main(java.lang.String[] args)
Tests and prints results of all methods (all are static) |
Vec |
normalToTriangle()
Finds the unit normal to a triangle. |
java.lang.String |
toString()
Lists the three vertices |
static Triangle |
transformTriangle(Mat mat,
Triangle t1)
Produces a copy of the triangle after a linear transform is applied. |
void |
transformTriangleSame(Mat mat)
Alters this triangle by applying a linear transform is applied. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public Vec[] tri
public Vec normal
public java.awt.Color color
Constructor Detail |
public Triangle()
public Triangle(Vec v0, Vec v1, Vec v2, java.awt.Color c)
Method Detail |
public static void main(java.lang.String[] args)
public java.lang.String toString()
public static Triangle transformTriangle(Mat mat, Triangle t1)
mat
- The linear transform.t1
- The triangle to be transformed.
public void transformTriangleSame(Mat mat)
mat
- The linear transform.public Vec normalToTriangle()
public void drawTri(java.awt.Graphics g)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |