|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectrender.Geometry
render.InteractiveMesh
render.InteractiveRenderer
| Field Summary | |
boolean |
enableLod
Enables level of detail computation for meshes. |
int |
m
|
int |
n
|
double |
phi
Euler angle for camera positioning (vertical view rotation). |
Renderer |
renderer
Rendererobject |
double |
theta
Euler angle for camera positioning (horizontal view rotation). |
Geometry |
world
root of the scene Geometry |
| Fields inherited from class render.Geometry |
animated, Bezier, BezierInverse, boneG, bones, boneW, BSpline, calllistnum, CatmullRom, child, faces, facesBuffer, globalMatrix, Hermite, material, name, noiseOrigin, normalBuffer, pullMask, pullWeight, refVertices, textureBuffer, verticeBuffer, verticedepth, vertices |
| Constructor Summary | |
InteractiveRenderer()
|
|
InteractiveRenderer(int m,
int n,
int w,
int h)
|
|
| 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). |
void |
animate(double time)
This animate gets called by the main renderer |
void |
damage()
Forces a refresh of the renderer. |
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 |
getPoint(int x,
int y,
double[] xyz)
Returns the location in world space of the point (x, y) on the screen. |
void |
ianimate(double time)
Override this to animate. |
void |
identity()
Sets current matrix to the identity matrix. |
void |
init()
Initializes the applet and internal variables. |
void |
initialize()
Override this to initialize the application program. |
boolean |
keyUp(int key)
KeyListener sends commands to the processKey function |
Matrix |
m()
Returns the matrix at the top of the stack. |
boolean |
mouseDown(java.awt.Event evt,
double[] xyz,
Geometry g)
|
boolean |
mouseDown(int x,
int y)
Listener for mouse down. |
boolean |
mouseDrag(java.awt.Event evt,
double[] xyz)
|
boolean |
mouseDrag(int x,
int y)
Dragging the mouse causes gradual view rotation in the phi and theta directions. |
boolean |
mouseMove(int x,
int y)
Listener for mouse movement. |
boolean |
mouseUp(java.awt.Event evt,
double[] xyz)
|
boolean |
mouseUp(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)
Handles commands received (generally for unicode commands from the KeyListener, but also for commands from any other sources, like buttons from webpages) : 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 |
rotate(double t,
double x,
double y,
double z)
Rotates the top matrix around an arbitrary axis by angle t (radians). |
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()
main renderer |
void |
scale(double x,
double y,
double z)
Scales the top matrix by x, y, z in their respective dimensions. |
void |
setBgColor(double r,
double g,
double b)
Sets the background color ( RGB values range: 0..1) |
void |
setFL(double value)
Sets the camera's focal length. |
void |
setFOV(double value)
Sets the field of view value. |
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. |
| Methods inherited from class render.InteractiveMesh |
find, getXY, getXYZ, isSelected |
| Methods inherited from class render.Geometry |
add, add, addImprovedNoise, addNoise, addNoise, ball, bezeledCube, child, computedMeshNormals, computeMeshNormals, computePolyhedronNormals, computeSurfaceNormals, contains, copyVertex, copyVertices, copyVertices, cube, cylinder, delete, delete, disk, displaceByImprovedNoise, extrusion, gear, gearDisk, gearTube, gearTube, getBone, getBoneG, getBoneW, getChildren, getglname, getMatrix, getMeshCols, getMeshRows, getOffset, getParent, globe, globe, isDescendant, isDoubleSided, lathe, latheGen, makeCircle, makeCurve, makeGear, makePath, mesh, mesh, patch, pill, pill, polygon, pull, pull, recomputeMeshNormals, setAnimated, setBone, setBones, setDoubleSided, setglname, setMaterial, setMatrix, setOffset, sew, sew, subdivide, superquadric, superquadric, torus, transform, tube, tube, wire, wire |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public Renderer renderer
Rendererobject
public Geometry world
Geometry
public boolean enableLod
public double theta
public double phi
public int n
public int m
| Constructor Detail |
public InteractiveRenderer()
public InteractiveRenderer(int m,
int n,
int w,
int h)
m - n - w - h - | Method Detail |
public void ianimate(double time)
time - system timepublic void animate(double time)
animate in class InteractiveMeshInteractiveMesh.animate(double)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 void setBgColor(double r,
double g,
double b)
r - red component 0..1g - green component 0..1b - blue component 0..1
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 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 rotate(double t,
double x,
double y,
double z)
t - angle in radiansx - y - z -
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 void init()
initialize().
initialize()public void initialize()
public void run()
public Geometry getGeometry(int x,
int y)
x - x coordinate in the imagey - y coordinate in the image
public boolean getPoint(int x,
int y,
double[] xyz)
x - x coordinate in the imagey - y coordinate in the image
public boolean mouseDown(java.awt.Event evt,
double[] xyz,
Geometry g)
mouseDown in class InteractiveMesh
public boolean mouseUp(java.awt.Event evt,
double[] xyz)
mouseUp in class InteractiveMesh
public boolean mouseDrag(java.awt.Event evt,
double[] xyz)
mouseDrag in class InteractiveMesh
public boolean mouseMove(int x,
int y)
public boolean mouseDown(int x,
int y)
public boolean mouseDrag(int x,
int y)
x - new x coordinatey - new y coordinate
public boolean mouseUp(int x,
int y)
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
x - current x coordinatey - current y coordinate
public boolean keyUp(int key)
Component.keyUp(java.awt.Event, int)public 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
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||