|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.j3d.threeD.raytracer.engine.AbstractSurface
net.sf.j3d.threeD.raytracer.primitives.Triangle
public class Triangle
A Triangle object represents a triangle in 3d space.
| Constructor Summary | |
|---|---|
Triangle()
Constructs a new Triangle object with all vertices at the origin that is black. |
|
Triangle(int p1,
int p2,
int p3,
RGB color,
Mesh.VertexData data)
|
|
Triangle(Vector p1,
Vector p2,
Vector p3)
Constructs a new Triangle object with the specified vertices that is black. |
|
Triangle(Vector p1,
Vector p2,
Vector p3,
RGB color)
Constructs a new Triangle object with the specified vertices with the color represented by the specified RGB object. |
|
| Method Summary | |
|---|---|
RGB |
getColorAt(Vector p)
Returns the color of this Surface object at the specified point as an RGB object. |
boolean |
getInterpolateVertexColor()
|
Vector |
getNormalAt(Vector point)
Returns a Vector object that represents the vector normal to this sphere at the point represented by the specified Vector object. |
double[][] |
getParticleVertices()
|
boolean |
getSmooth()
|
boolean |
getUseTransform()
|
Vector[] |
getVertices()
|
boolean |
intersect(Ray ray)
Returns true if the ray intersects the 3d surface in real space. |
Intersection |
intersectAt(Ray ray)
Returns an Intersection object representing the points along the ray represented by the specified Ray object that intersection between the ray and the triangle represented by this Triangle object occurs. |
void |
setInterpolateVertexColor(boolean vcolor)
Controls if vertex colors will be used and color will be interpolated across the triangle. |
void |
setSmooth(boolean s)
Sets the smooth flag which indicates if normal vectors should be interpolated. |
void |
setUseTransform(boolean use)
|
void |
setVertices(Vector p1,
Vector p2,
Vector p3)
Sets the vertices of this Triangle object to those specified. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Triangle()
public Triangle(Vector p1,
Vector p2,
Vector p3)
public Triangle(Vector p1,
Vector p2,
Vector p3,
RGB color)
public Triangle(int p1,
int p2,
int p3,
RGB color,
Mesh.VertexData data)
| Method Detail |
|---|
public void setVertices(Vector p1,
Vector p2,
Vector p3)
public Vector[] getVertices()
public void setUseTransform(boolean use)
use - If set to true, the intersection methods will apply the transformations stored by this
Triangle object. Otherwise, transformation will not be used. Setting to false is useful
if the Triangle vertices are absolute coordinates and/or if the Triangle is part of a Mesh
and the Mesh will apply all needed transformation.public boolean getUseTransform()
public void setInterpolateVertexColor(boolean vcolor)
vcolor - If true, color will be interpolated across the triangle based on vertex colors
and then mixed with the color of the triangle. If false, the color of the triangle
will be used all across the surface.public boolean getInterpolateVertexColor()
public void setSmooth(boolean s)
s - Value to use.public boolean getSmooth()
public double[][] getParticleVertices()
getParticleVertices in interface ParticleGroupParticleGroup.getParticleVertices()public Vector getNormalAt(Vector point)
getNormalAt in interface Surfacepublic RGB getColorAt(Vector p)
Surface
getColorAt in interface SurfacegetColorAt in class AbstractSurfacepublic boolean intersect(Ray ray)
Surface
intersect in interface Surfacepublic Intersection intersectAt(Ray ray)
intersectAt in interface Surfacepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||