|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsimogl.geometry.Triangle
public class Triangle
This class represents a triangle (polygon) that can be part of a mesh
| Constructor Summary | |
|---|---|
Triangle(Point3D p1,
Point3D p2,
Point3D p3)
Creates a triangle with the specified points as vertices. |
|
| Method Summary | |
|---|---|
float |
getLengthV1V2()
Returns the length of the edge between vertex1 and vertex2 |
float |
getLengthV1V3()
Returns the length of the edge between vertex1 and vertex3 |
float |
getLengthV2V3()
Returns the length of the edge between vertex2 and vertex3 |
Point3D |
getNormal()
Returns a point/vector representing the triangle's normal |
TextureCoordinate |
getTexCoordVertex1()
Returs the texture coordinate of vertex1 |
TextureCoordinate |
getTexCoordVertex2()
Returs the texture coordinate of vertex2 |
TextureCoordinate |
getTexCoordVertex3()
Returs the texture coordinate of vertex3 |
Point3D |
getVertex1()
Gets the first vertex of the triangle |
Point3D |
getVertex2()
Gets the second vertex of the triangle |
Point3D |
getVertex3()
Gets the third vertex of the triangle |
void |
setNormal(float x,
float y,
float z)
Sets the normal of this triangle to the specified values |
void |
setNormal(Point3D normal)
Sets the normal of the triangle to the specified point/vector |
void |
setTexCoords(float vert1_s,
float vert1_t,
float vert2_s,
float vert2_t,
float vert3_s,
float vert3_t)
Sets the triangle's texture coordinates |
void |
setTexCoordsVertex1(float s,
float t)
Sets the texture coordinates of vertex1 to the specifies s and t values. |
void |
setTexCoordsVertex2(float s,
float t)
Sets the texture coordinates of verte2 to the specifies s and t values. |
void |
setTexCoordsVertex3(float s,
float t)
Sets the texture coordinates of vertex3 to the specifies s and t values. |
void |
setVertex1(Point3D point)
Sets the first vertex if the triangle |
void |
setVertex2(Point3D point)
Sets the second vertex if the triangle |
void |
setVertex3(Point3D point)
Sets the third vertex if the triangle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Triangle(Point3D p1,
Point3D p2,
Point3D p3)
p1 - point that will be vertex1p2 - point that will be vertex2p3 - point that will be vertex3| Method Detail |
|---|
public Point3D getNormal()
public void setNormal(float x,
float y,
float z)
x - x-coordinatey - y-coordinatez - z-coordinatepublic void setNormal(Point3D normal)
normal - value to set the normal topublic float getLengthV1V2()
public float getLengthV1V3()
public float getLengthV2V3()
public Point3D getVertex1()
public void setVertex1(Point3D point)
point - point that will be the first vertexpublic Point3D getVertex2()
public void setVertex2(Point3D point)
point - point that will be the second vertexpublic Point3D getVertex3()
public void setVertex3(Point3D point)
point - that will be the third vertex
public void setTexCoords(float vert1_s,
float vert1_t,
float vert2_s,
float vert2_t,
float vert3_s,
float vert3_t)
vert1_s - vertex1 s-coordinatevert1_t - vertex1 t-coordinatevert2_s - vertex2 s-coordinatevert2_t - vertex2 t-coordinatevert3_s - vertex3 s-coordinatevert3_t - vertex3 t-coordinate
public TextureCoordinate getTexCoordVertex1()
public void setTexCoordsVertex1(float s,
float t)
s - s-coordinatet - t-coordinate
public TextureCoordinate getTexCoordVertex2()
public void setTexCoordsVertex2(float s,
float t)
s - s-coordinatet - t-coordinate
public TextureCoordinate getTexCoordVertex3()
public void setTexCoordsVertex3(float s,
float t)
s - s-coordinatet - t-coordinate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||