org.fixbin.ddd
Class Quadrangle

java.lang.Object
  extended byorg.fixbin.ddd.Quadrangle
All Implemented Interfaces:
Object3D

public class Quadrangle
extends java.lang.Object
implements Object3D


Constructor Summary
Quadrangle(Point sun, Point p1, Point p2, Point p3, Point p4, int r, int g, int b)
          Creates a new instance of Quadrangle
 
Method Summary
 void drawQuadrangle(Graphics g, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
           
 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
 

Constructor Detail

Quadrangle

public Quadrangle(Point sun,
                  Point p1,
                  Point p2,
                  Point p3,
                  Point p4,
                  int r,
                  int g,
                  int b)
Creates a new instance of Quadrangle

Method Detail

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)

drawQuadrangle

public void drawQuadrangle(Graphics g,
                           int x1,
                           int y1,
                           int x2,
                           int y2,
                           int x3,
                           int y3,
                           int x4,
                           int y4)

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