public class

Triangle

extends Element
java.lang.Object
   ↳ casmi.graphics.element.Element
     ↳ casmi.graphics.element.Triangle

Class Overview

Triangle class. Wrap JOGL and make it easy to use.

Summary

Constants
int TRIANGLE
int TRIANGLE_3D
[Expand]
Inherited Fields
From class casmi.graphics.element.Element
Public Constructors
Triangle(double x1, double y1, double x2, double y2, double x3, double y3)
Creates a new Triangle object using x,y-coordinate of corners.
Triangle(Vector3D v1, Vector3D v2, Vector3D v3)
Creates a new Triangle object using x,y-coordinate of corners.
Triangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
Creates a new Triangle object using x,y-coordinate of corners.
Public Methods
Vector3D getConer(int number)
void render(GL2 gl, GLU glu, int width, int height, boolean selection)
void reset(GL2 gl)
void set(Vector3D v1, Vector3D v2, Vector3D v3)
Sets x,y-coordinate of corners.
void set(double x1, double y1, double x2, double y2, double x3, double y3)
Sets x,y-coordinate of corners.
void set(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
Sets x,y-coordinate of corners.
void setConer(int number, Vector3D v)
void setCorner(int number, double x, double y)
void setCorner(int number, double x, double y, double z)
void setCornerColor(int index, Color color)
Sets the color of the corner for gradation.
void setCornerColor(int index, ColorSet colorSet)
Sets the color of the corner for gradation.
void setPosition(double x, double y, double z)
Sets the position of the Element in 3D.
void setPosition(double x, double y)
Sets the position of the Element in 2D.
[Expand]
Inherited Methods
From class casmi.graphics.element.Element
From class java.lang.Object
From interface casmi.graphics.object.Renderable
From interface casmi.graphics.object.Resettable

Constants

public static final int TRIANGLE

Constant Value: 0 (0x00000000)

public static final int TRIANGLE_3D

Constant Value: 4 (0x00000004)

Public Constructors

public Triangle (double x1, double y1, double x2, double y2, double x3, double y3)

Creates a new Triangle object using x,y-coordinate of corners.

Parameters
x1 The x-coordinate of the first corner.
y1 The y-coordinate of the first corner.
x2 The x-coordinate of the second corner.
y2 The y-coordinate of the second corner.
x3 The x-coordinate of the third corner.
y3 The y-coordinate of the third corner.

public Triangle (Vector3D v1, Vector3D v2, Vector3D v3)

Creates a new Triangle object using x,y-coordinate of corners.

Parameters
v1 The coordinates of the first corner.
v2 The coordinates of the second corner.
v3 The coordinates of the third corner.

public Triangle (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)

Creates a new Triangle object using x,y-coordinate of corners.

Parameters
x1 The x-coordinate of the first corner.
y1 The y-coordinate of the first corner.
z1 The z-coordinate of the first corner.
x2 The x-coordinate of the second corner.
y2 The y-coordinate of the second corner.
z2 The z-coordinate of the second corner.
x3 The x-coordinate of the third corner.
y3 The y-coordinate of the third corner.
z3 The z-coordinate of the third corner.

Public Methods

public Vector3D getConer (int number)

public void render (GL2 gl, GLU glu, int width, int height, boolean selection)

public void reset (GL2 gl)

public void set (Vector3D v1, Vector3D v2, Vector3D v3)

Sets x,y-coordinate of corners.

Parameters
v1 The coordinates of the first corner.
v2 The coordinates of the second corner.
v3 The coordinates of the third corner.

public void set (double x1, double y1, double x2, double y2, double x3, double y3)

Sets x,y-coordinate of corners.

Parameters
x1 The x-coordinate of the first corner.
y1 The y-coordinate of the first corner.
x2 The x-coordinate of the second corner.
y2 The y-coordinate of the second corner.
x3 The x-coordinate of the third corner.
y3 The y-coordinate of the third corner.

public void set (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)

Sets x,y-coordinate of corners.

Parameters
x1 The x-coordinate of the first corner.
y1 The y-coordinate of the first corner.
z1 The z-coordinate of the first corner.
x2 The x-coordinate of the second corner.
y2 The y-coordinate of the second corner.
z2 The z-coordinate of the second corner.
x3 The x-coordinate of the third corner.
y3 The y-coordinate of the third corner.
z3 The z-coordinate of the third corner.

public void setConer (int number, Vector3D v)

public void setCorner (int number, double x, double y)

public void setCorner (int number, double x, double y, double z)

public void setCornerColor (int index, Color color)

Sets the color of the corner for gradation.

Parameters
index The index of the corner.
color The color of the corner.

public void setCornerColor (int index, ColorSet colorSet)

Sets the color of the corner for gradation.

Parameters
index The index of the corner.
colorSet The colorSet of the corner.

public void setPosition (double x, double y, double z)

Sets the position of the Element in 3D.

Parameters
x x-coordinate
y y-coordinate
z z-coordinate

public void setPosition (double x, double y)

Sets the position of the Element in 2D.

Parameters
x x-coordinate
y y-coordinate