|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrender.Renderer
Provides the computational functionality to render geometric objects in realtime.
| Field Summary | |
boolean |
bufferg
Flag that determines whether to keep a z-buffer of geometries, to to know the frontmost object at any position (x, y) in the image. |
protected int |
H
|
boolean |
isHeadsUp
Determines whether the camera tries to maintain a "heads up" orientation. |
int |
lod
Set the level of detail for meshes. |
protected int[] |
pix
|
boolean |
seeMesh
When set true, only the wireframe structure of the objects is displayed using appropriate colors. |
boolean |
showMesh
Shows/overlays the geometry mesh in black when true. |
static boolean |
tableMode
Flag controls table lookup mode for materials, true means on. |
boolean |
updateTransparency
Allocate space for transparent objects when true. |
protected int |
W
|
| Constructor Summary | |
Renderer()
|
|
| Method Summary | |
void |
addLight(double x,
double y,
double z,
double r,
double g,
double b)
Add a light source where x,y,z are light source direction; r,g,b are light source color. |
void |
colorLight(int i,
double r,
double g,
double b)
Assigns new color values to the light i. |
Matrix |
getCamera()
Returns the matrix that defines the camera transformation. |
Geometry |
getGZbuffer(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). |
int |
getNumberOfLights()
Returns the number of lights in the scene. |
double |
getOutline()
Returns the outline threshold parameter for sketch-like (artistic) rendition of the scene. |
Geometry |
getWorld()
Returns the root of the geometry tree. |
void |
headsUp(boolean tf)
Sets whether the camera tries to maintain a "heads up" orientation. |
int[] |
init(int W,
int H)
Initializes the renderer. |
static boolean |
isDragging()
Returns whether dragging is active or not. |
void |
outline(double t)
Thresholds t to produce a sketch-like (artistic) rendition of the scene. |
void |
placeLight(int i,
double x,
double y,
double z)
Moves an already defined light i, to point in the new direction of normalized [x, y, z]. |
void |
refresh()
Force a refresh of the entire window. |
void |
render()
Render the entire world for this frame. |
static void |
renderVertex(double[] v,
Material m)
Renders vertex v with material m, if table mode is enabled the data is just looked up in the material's table, otherwise it is computed. |
static void |
renderVertex(int i,
Material m)
Renders vertex i ( packed x,y,z) with material m. |
void |
rotateView(double t,
double p)
Rotate angle of view. |
void |
setBgColor(double r,
double g,
double b)
Set the background fill color. |
void |
setCamera(double theta,
double phi)
Forces an absolute value for the camera matrix. |
void |
setCamera(Matrix m)
Sets the camera matrix directly. |
static void |
setDragging(boolean tf)
If the user is interactively dragging the mouse, we want the renderer to know about it, so that any other background process (eg: a material which is building a lookup table) can ask the renderer, and thereby avoid consuming scarce CPU resources simultaneously. |
void |
setFL(double value)
Sets the camera's focal length. |
void |
setFOV(double value)
Sets the camera field of view. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static boolean tableMode
public int lod
public boolean showMesh
public boolean updateTransparency
public boolean bufferg
getGZbuffer(int x, int y)public boolean isHeadsUp
public boolean seeMesh
protected int W
protected int H
protected int[] pix
| Constructor Detail |
public Renderer()
| Method Detail |
public int[] init(int W,
int H)
W - framebuffer widthH - framebuffer height.
public static void setDragging(boolean tf)
tf - dragging true or falsepublic static boolean isDragging()
public void setCamera(double theta,
double phi)
theta - horizontal angle (radians)phi - vertical angle (radians)public void headsUp(boolean tf)
tf - value true or falsepublic void setFL(double value)
value - focal lenghpublic void setFOV(double value)
value - field of viewpublic Geometry getWorld()
public void setBgColor(double r,
double g,
double b)
public void addLight(double x,
double y,
double z,
double r,
double g,
double b)
public int getNumberOfLights()
public void placeLight(int i,
double x,
double y,
double z)
i - the index of the light to be changedx - x direction of the lighty - y direction of the lightz - z direction of the light
public void colorLight(int i,
double r,
double g,
double b)
i - index of the light to changer - the red color component valueg - the green color componentb - the blue color component
public void rotateView(double t,
double p)
public Matrix getCamera()
public void setCamera(Matrix m)
public void render()
public double getOutline()
public void outline(double t)
t - outline thresholdpublic void refresh()
public static void renderVertex(int i,
Material m)
i - vertex to be renderedm - material properties to be applied to the vertex
public static void renderVertex(double[] v,
Material m)
v - vertex x,y,z and the r,g,b values for it.m - material with which to render the vertex.
public Geometry getGZbuffer(int x,
int y)
x - x coordinate in the imagey - y coordinate in the image
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||