|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectrender.RenderCore
| Constructor Summary | |
RenderCore(RenderablePanel parentComponent)
METHODS |
|
| Method Summary | |
void |
addLight(double x,
double y,
double z,
double r,
double g,
double b)
Adds light source with direction (x, y, z) & color (r, g, b). |
Widget |
addMenu(java.lang.String label,
int x,
int y)
|
void |
addMenu(Widget menu)
|
void |
damage()
Forces a refresh of the renderer. |
double |
getCurrentTime()
Get the current system time in seconds |
double |
getFL()
gets the camera's focal length. |
double |
getFOV()
gets the field of view value. |
Geometry |
getGeometry(int x,
int y)
Returns the Geometry of the frontmost object at the point (x, y) in the image (like a z-buffer value of geometries). |
boolean |
getGeometryBuffer()
|
int |
getLod()
|
Matrix[] |
getMatrix()
|
int[] |
getPix()
returns the pix array |
boolean |
getPoint(int x,
int y,
double[] xyz)
Returns xyz world coords of the frontmost object at pixel (x,y) |
Renderable |
getRenderable()
|
Renderer |
getRenderer()
|
Geometry |
getWorld()
|
void |
identity()
Sets current matrix to the identity matrix. |
void |
init()
Initializes the applet and internal variables. |
boolean |
keyUp(java.awt.Event event,
int key)
|
Matrix |
m()
Returns the matrix at the top of the stack. |
Widget |
menu(int i)
|
boolean |
mouseDown(java.awt.Event event,
int x,
int y)
Listener for mouse down. |
boolean |
mouseDrag(java.awt.Event event,
int x,
int y)
Dragging the mouse causes gradual view rotation in the phi and theta directions. |
boolean |
mouseMove(java.awt.Event event,
int x,
int y)
Listener for mouse movement. |
boolean |
mouseUp(java.awt.Event event,
int x,
int y)
Listens for mouse release and controls aspects of the renderer. |
void |
pause()
prevents the renderer from redrawing the scene. |
void |
pop()
Pops the top matrix from the stack. |
boolean |
processCommand(int key)
Keyboard listener: various default control keys to modify render style (Use CTRL + key). |
int |
pull(Geometry s,
double x0,
double x1,
double x2,
double y0,
double y1,
double y2,
double z0,
double z1,
double z2)
Deforms a geometric shape according to the beginning, middle, and end parameters in each dimension. |
void |
push()
Pushes a copy of the top matrix onto the stack. |
void |
removeMenu(Widget menu)
|
void |
rotateX(double t)
Rotates the top matrix around the X axis by angle t (radians). |
void |
rotateY(double t)
Rotates the top matrix around the Y axis by angle t (radians). |
void |
rotateZ(double t)
Rotates the top matrix around the Z axis by angle t (radians). |
void |
run()
Renderer thread |
void |
scale(double x,
double y,
double z)
Scales the top matrix by x, y, z in their respective dimensions. |
void |
setFL(double value)
Sets the camera's focal length. |
void |
setFOV(double value)
Sets the field of view value. |
void |
setGeometryBuffer(boolean value)
|
void |
setLod(int value)
|
void |
setRenderable(Renderable renderable)
|
void |
setRenderer(Renderer renderer)
|
void |
start()
Starts the renderer thread. |
void |
stop()
Stops the renderer thread. |
void |
transform(Geometry s)
Applies the top transformation matrix to Geometrys. |
void |
translate(double[] v)
Translates the top matrix by vector v. |
void |
translate(double x,
double y,
double z)
Translates the top matrix by x, y, z. |
void |
update(java.awt.Graphics g)
Updates the image buffer to output device. |
Widget |
widgetAt(int x,
int y)
Find the widget at the mouse. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RenderCore(RenderablePanel parentComponent)
| Method Detail |
public void init()
#initialize().
#initialize()public double getCurrentTime()
public void pause()
public void damage()
public void setFOV(double value)
value - Renderer.setFOV(double value)public void setFL(double value)
value - focal lengthRenderer.setFL(double value)public double getFOV()
Renderer#getFOV(double value)public double getFL()
Renderer.setFL(double value)public int[] getPix()
#pix
public boolean getPoint(int x,
int y,
double[] xyz)
x - x pixel coordinatey - y pixel coordinatexyz - output point in world coords
public Geometry getGeometry(int x,
int y)
x - x coordinate in the imagey - y coordinate in the image
public Widget widgetAt(int x,
int y)
public void addLight(double x,
double y,
double z,
double r,
double g,
double b)
Renderer.addLight(double x,double y,double z, double r,double
g,double b)public Matrix[] getMatrix()
public void identity()
public Matrix m()
public void pop()
public void push()
public void rotateX(double t)
t - angle in radianspublic void rotateY(double t)
t - angle in radianspublic void rotateZ(double t)
t - angle in radians
public void scale(double x,
double y,
double z)
x - x scale factory - y scale factorz - z scale factorpublic void transform(Geometry s)
Geometrys.
s - Geometry objectpublic void translate(double[] v)
v - an array of three doubles representing translations in the
x,y,z directions.
public void translate(double x,
double y,
double z)
x - -
translation in the x direction.y - -
translation in the y direction.z - -
translation in the z direction.
public int pull(Geometry s,
double x0,
double x1,
double x2,
double y0,
double y1,
double y2,
double z0,
double z1,
double z2)
0 - beginning, 1 - middle, 2 - end. To indicate infinity (a constant transformation) set two adjacent parameters to the same value. Setting all three parameters to the same value transforms the shape geometry consistently across the entire axis of the parameters.
s - shape object to be deformedx0 - location of beginning of deformation along the x axisx1 - location of beginning of deformation along the x axisx2 - location of beginning of deformation along the x axisy0 - location of beginning of deformation along the y axisy1 - location of beginning of deformation along the y axisy2 - location of beginning of deformation along the y axisz0 - location of beginning of deformation along the z axisz1 - location of beginning of deformation along the z axisz2 - location of beginning of deformation along the z axis
Geometry.pull(render.Matrix, double, double, double, double, double, double, double, double, double)public Geometry getWorld()
public Widget addMenu(java.lang.String label,
int x,
int y)
public void addMenu(Widget menu)
public Widget menu(int i)
public void removeMenu(Widget menu)
public void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic void update(java.awt.Graphics g)
g - Specifies the output device.
public boolean mouseMove(java.awt.Event event,
int x,
int y)
public boolean mouseDown(java.awt.Event event,
int x,
int y)
public boolean mouseUp(java.awt.Event event,
int x,
int y)
A release in the upper left corner toggles Renderer.tableMode.
A release in the upper right corner toggle visibility of the
Material#tabledisplay. When true, the current material table is
displayed in the upper left corner of the window. Position of the mouse
determines current material.
A release in the lower right toggles Renderer.showMesh
event - Eventx - current x coordinatey - current y coordinate
public boolean mouseDrag(java.awt.Event event,
int x,
int y)
event - Eventx - -
new x coordinatey - -
new y coordinatepublic boolean processCommand(int key)
'e' - toggles Renderer.showMesh, that just displays the shapes
as mesh wireframes
'l' - toggles Renderer.getOutline()which produces a sketch-line
drawing rendition of the scene
'm' - toggles Renderer.seeMeshwhich determines mesh visibility
't' - toggles global texture manipulation method (MIP on/off) (@link
Texture#useMIP)
key - value of the key released
public boolean keyUp(java.awt.Event event,
int key)
public Renderable getRenderable()
public void setRenderable(Renderable renderable)
renderable - The renderable to set.public Renderer getRenderer()
public void setRenderer(Renderer renderer)
renderer - The renderer to set.public void setLod(int value)
public int getLod()
public boolean getGeometryBuffer()
public void setGeometryBuffer(boolean value)
value - enables or disables the geometry z-buffer.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||