|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--render.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 |
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 |
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). |
Geometry |
getGeometry(int x,
int y,
double[] xyz)
Returns the Geometry of the frontmost object at the point (x, y) in screenspace along with the coordinates of that point in world space. |
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 |
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 |
refresh()
Force a refresh of the entire window. |
int[] |
reinit(int W,
int H)
Initializes the renderer. |
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 |
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. |
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
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 seeMesh
Constructor Detail |
public Renderer()
Method Detail |
public int[] init(int W, int H)
W
- framebuffer widthH
- framebuffer height.
public int[] reinit(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 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 lightpublic 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 componentpublic 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)
manualCameraControl
flag to be turned on).
public double[] getCameraPos()
public void setCameraAim(double px, double py, double pz)
manualCameraControl
flag to be turned on).
public double[] getCameraAim()
public void setCameraUp(double px, double py, double pz)
manualCameraControl
flag 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 static void renderVertex(int i, Material m)
i
- vertex to be renderedm
- material properties to be applied to the vertexpublic 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 getGeometry(int x, int y)
x
- x coordinate in the imagey
- y coordinate in the image
public Geometry getGeometry(int x, int y, double[] xyz)
x
- x coordinate in the imagey
- y coordinate in the imagexyz
- point in world coordinates, if geometry != null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |