org.fixbin.ddd
Class Triangle
java.lang.Object
org.fixbin.ddd.Triangle
- All Implemented Interfaces:
- Object3D
- public class Triangle
- extends java.lang.Object
- implements Object3D
|
Method Summary |
static void |
drawTriangle(Graphics g,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
|
long |
getDistance()
This method returns the "z" distance from the camera (required for sorting) |
void |
render(Graphics g)
This method requests the object to render itself to a graphics object.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Triangle
public Triangle(Point sun,
Point p1,
Point p2,
Point p3,
int r,
int g,
int b)
- Creates a new instance of Triangle
drawTriangle
public static void drawTriangle(Graphics g,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
render
public void render(Graphics g)
- Description copied from interface:
Object3D
- This method requests the object to render itself to a graphics object.
This can be the screen, an image, file, etc.
- Specified by:
render in interface Object3D
- Parameters:
g - (Graphics) the graphics interface to render to
getDistance
public long getDistance()
- Description copied from interface:
Object3D
- This method returns the "z" distance from the camera (required for sorting)
- Specified by:
getDistance in interface Object3D
- Returns:
- the distance (long)