|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectrender.Renderer
| 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. |
boolean |
isAnaglyph
|
boolean |
isHeadsUp
Determines whether the camera tries to maintain a "heads up" orientation. |
int |
lod
Set the level of detail for meshes. |
boolean |
manualCameraControl
flag that enables full manual camera control for setting camera location, aim target, and the up vector. |
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. |
| 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. |
int |
getBgColor()
Returns the background color. |
Matrix |
getCamera()
Returns the matrix that defines the camera transformation. |
double[] |
getCameraAim()
returns the current target look-at point of the camera |
double[] |
getCameraPos()
returns the current position of the camera |
double[] |
getCameraUp()
returns the current up vector of the camera |
double |
getClippingPlaneEpsilon()
Returns the distance of the clipping plane from the camera lens. |
double |
getCx()
|
double |
getCy()
|
double |
getFL()
Returns the camera's focal length |
double |
getFOV()
Returns the camera field of view. |
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 |
getH()
|
int |
getLod()
|
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. |
void |
getPoint(double[] xyz,
int[] p_xy)
Puts in p_xy the pixel point that x, y, z corresponds to. |
boolean |
getPoint(int ix,
int iy,
double[] xyz)
|
void |
getPoint(int ix,
int iy,
double z,
double[] xyz)
Given z value of point to determine where 2d points ix,iy convert to. |
int |
getW()
|
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. |
boolean |
isFixedLightPositions()
Returns true if light positions remain fixed in the world regardless of camera orientation. |
void |
lookAt(double[] eye,
double[] center,
double[] up)
Sets the camera to move to the eye position, aim at the center, and maintain the up direction ( requires the manualCameraControl
flag to be turned on). |
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 |
projectPoint(double[] vp)
|
void |
refresh()
Force a refresh of the entire window. |
void |
render()
Render the entire world for this frame. |
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 |
setBgColor(int color)
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. |
void |
setCameraAim(double px,
double py,
double pz)
Sets the aiming point at which the camera should point. |
void |
setCameraPos(double px,
double py,
double pz)
Sets the position of the camera. |
void |
setCameraUp(double px,
double py,
double pz)
Sets the cameraUp vector (must be a unit vector). |
void |
setClippingPlaneEpsilon(double e)
Sets the distance of the clipping plane in front of the camera lens. |
void |
setCx(double x)
|
void |
setCy(double y)
|
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 |
setFixedLightPositions(boolean isFixedLightPositions)
Sets whether light positions follow the camera or remain fixed in the world regardless of camera orientation. |
void |
setFL(double value)
Sets the camera's focal length. |
void |
setFOV(double value)
Sets the camera field of view. |
void |
setGeometryBuffer(boolean value)
|
void |
setH(int h)
|
void |
setLod(int lod)
|
void |
setW(int w)
|
void |
xf(Matrix m,
double x,
double y,
double z,
double w,
double[] v)
|
| Methods inherited from class java.lang.Object |
equals, 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
getGeometry(int x, int y)public boolean isHeadsUp
public boolean manualCameraControl
lookAt(double[], double[], double[]),setCameraPos(double, double, double),setCameraAim(double, double, double),
setCameraUp(double, double, double). When false you can use :
setCamera(double, double)
public boolean isAnaglyph
public boolean seeMesh
| 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 double getFL()
public void setW(int w)
public void setH(int h)
public int getW()
public int getH()
public void setFOV(double value)
value - field of viewpublic double getFOV()
public Geometry getWorld()
public void setBgColor(double r,
double g,
double b)
public void setBgColor(int color)
public int getBgColor()
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 void lookAt(double[] eye,
double[] center,
double[] up)
manualCameraControl
flag to be turned on).
eye - new position of the camera ( double[x, y, z] )center - aim point of the camera ( double[x, y, z] )up - unit vector specifying the up direction in the world (
double[x, y, z] )public Matrix getCamera()
public void setCamera(Matrix m)
public void setCameraPos(double px,
double py,
double pz)
manualCameraControlflag to be turned on).
public double[] getCameraPos()
public void setCameraAim(double px,
double py,
double pz)
manualCameraControlflag to be turned on).
public double[] getCameraAim()
public void setCameraUp(double px,
double py,
double pz)
manualCameraControlflag to be turned on).
px - py - pz - public double[] getCameraUp()
public void setClippingPlaneEpsilon(double e)
e - the actual disancepublic double getClippingPlaneEpsilon()
public void render()
public double getOutline()
public void outline(double t)
t - outline thresholdpublic void refresh()
public void setCx(double x)
public void setCy(double y)
public double getCx()
public double getCy()
public void projectPoint(double[] vp)
public void xf(Matrix m,
double x,
double y,
double z,
double w,
double[] v)
public static void renderVertex(int i,
Material m)
i - vertex to be renderedm - material properties to be applied to the vertex
public 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 getGeometry(int x,
int y)
x - x coordinate in the imagey - y coordinate in the image
public boolean getPoint(int ix,
int iy,
double[] xyz)
public void getPoint(int ix,
int iy,
double z,
double[] xyz)
public void getPoint(double[] xyz,
int[] p_xy)
public int getLod()
public void setLod(int lod)
lod - The level of detail to set.public boolean getGeometryBuffer()
public void setGeometryBuffer(boolean value)
value - enables or disables the geometry z-buffer.public boolean isFixedLightPositions()
public void setFixedLightPositions(boolean isFixedLightPositions)
isFixedLightPositions - If true light positions remain fixed in the world regardless of camera orientation.
Otherwise light positions will follow the camera.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||