|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Scene
A class to provide methods to draw objects in 3D world onto a Graphics object
version :
01/10/1997 original program in C written by Eleanor Yu and Ho Ng
09/08/1998 translated into Java by Ho Ng
12/08/1998 modified by Ho Ng
01/09/1998 modified by Ho Ng to support classes Polygon3D and Object3D
Constructor Summary | |
Scene()
Default constructor purpose : initialize the Scene object and set the output screen size to 512x512 |
|
Scene(int usize,
int vsize)
Constructor purpose : initialize the Scene object |
Method Summary | |
void |
drawObject3D(Object3D obj,
java.awt.Graphics g)
purpose : project and draw the Object3D onto the Graphics |
void |
drawPolygon3D(Polygon3D poly,
java.awt.Graphics g)
purpose : project and draw the Polygon3D onto the Graphics |
boolean |
setCamera(Vector3D lookFrom,
Vector3D lookAt,
Vector3D lookUp)
purpose : set the position and orientation of the carmera |
void |
setCTM(Matrix m)
purpose : change the current transformational matrix |
void |
setScreen(int maxU,
int maxV)
purpose : set the output screen |
void |
setViewport(double llx,
double lly,
double urx,
double ury)
purpose : set the viewport of the output |
void |
setViewVolume(double width,
double height,
double distance,
double near,
double far)
purpose : set the view volume of the camera |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Scene()
public Scene(int usize, int vsize)
usize
- total number of pixels horizontallyvsize
- total number of pixels verticallyMethod Detail |
public void setCTM(Matrix m)
m
- new current transformational matrixpublic boolean setCamera(Vector3D lookFrom, Vector3D lookAt, Vector3D lookUp)
lookFrom
- position of the cameralookAt
- target's position of the cameralookUp
- orientation of the camerapublic void setViewVolume(double width, double height, double distance, double near, double far)
width
- widthheight
- heightdistance
- distancenear
- nearfar
- farpublic void setViewport(double llx, double lly, double urx, double ury)
public void setScreen(int maxU, int maxV)
maxU
- total number of pixels of the screen horizontallymaxV
- total number of pixels of the screen verticallypublic void drawPolygon3D(Polygon3D poly, java.awt.Graphics g)
poly
- Polygon3Dg
- Graphicspublic void drawObject3D(Object3D obj, java.awt.Graphics g)
obj
- Object3Dg
- Graphics
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |