|
Bouncy Castle Rendering Toolkit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.bouncycastle.graphics.rt.Camera
Class for the generic stationary camera.
Sample RML for a camera is:
<Camera>
<Perspective fov="45.0"/>
<LookAt eye="0, 0, 5" reference="0, 0, 0" up="0, 1, 0"/>
</Camera>
Document Type Definition:
<!ENTITY %Float "CDATA">
<!ENTITY %Point3f "CDATA">
<!ENTITY %Vector3f "CDATA">
<!ELEMENT Camera ((Perspective | Ortho)?, LookAt, Twist?, DepthOfField?) >
<!ELEMENT Ortho EMPTY>
<!ATTLIST Ortho
left %Float; "-1"
right %Float; "1"
bottom %Float; "-1"
top %Float; "1"
near %Float; "0"
far %Float; "Float.POSITIVE_INFINITY">
<!ELEMENT Perspective EMPTY>
<!ATTLIST Perspective
fov %Float; "45"
zNear %Float; "0"
zFar %Float; "Float.POSITIVE_INFINITY">
<!ELEMENT LookAt EMPTY>
<!ATTLIST LookAt
eye %Point3f; "0, 0, 0"
reference %Point3f; "0, 0, -1"
up %Vector3f; "0, 1, 0">
<!ELEMENT Twist EMPTY>
<!ATTLIST Twist
angle %Float; "0">
<!ELEMENT DepthOfField EMPTY>
<!ATTLIST DepthOfField
fStop %Float;
focalLength %Float;
focalDistance %Float;>
Constructor Summary | |
Camera()
|
Method Summary | |
protected void |
calculateViewMatrix(Matrix4f trans)
|
void |
configureLenseMask(int samples,
boolean jitter)
|
void |
depthOfField(double fStop,
double focalLength,
double focalDistance)
In the normal situation with a real camera the diameter of the lense opening means that the camera is only capable of rendering objects sharply over a limited range of distances. |
Ray |
generateRay(int sampleNo,
int time,
float x,
float y)
|
static Camera |
getInstance(RMLReader in)
|
java.lang.String |
getName()
|
void |
lookAt(Point3f eye,
Point3f ref,
Vector3f up)
set the "look at" details for the camera. |
void |
ortho(double left,
double right,
double bottom,
double top,
double near,
double far)
Define a three dimensional viewing box by giving the left, right, bottom and top clipping plane locations and the distances along the line of sight to the near and far clipping planes. |
void |
perspective(double fov)
Specify a perspective projection for the image, with the near clipping plan at 0 and the far one at infinity. |
void |
perspective(double fov,
double zNear,
double zFar)
Specify a perspective viewing pyramid in world coordinates by giving a field of view and the locations of the near(zNear) and far(zFar) clipping planes in the z direction. |
void |
twist(double twist)
set a twist about the line of sight. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Camera()
Method Detail |
public static Camera getInstance(RMLReader in) throws java.io.IOException
public java.lang.String getName()
protected void calculateViewMatrix(Matrix4f trans)
public void lookAt(Point3f eye, Point3f ref, Vector3f up)
eye
- the eye position.ref
- the point we are looking at.up
- the direction of world up.public void twist(double twist)
the
- twist angle, in degrees.public void depthOfField(double fStop, double focalLength, double focalDistance)
The default for a camera in our situation, is that it's a pin-hole and has an infinite depth of field. Finite depth of field, however, adds additional cues for depth perception, as well as adding an aesthetic touch to the image.
To add depth of field to an image we have to specify, a focal distance, a focal length, and the f-stop. The f-stop represents the size of the aperture admitting light into the camera, and the depth of field is determined by the ratio of the focal length to the f-stop and the focal distance.
Generaly the length units are millimeters, but in this case the units used are irrelevant, the units for focal length just need to be the same as for the focal distance.
fStop
- the f-stop for the camera.focalLength
- the focal length of the lense.focalDistance
- distance at which objects will appear sharpest.public void perspective(double fov)
fov
- the field of view.public void perspective(double fov, double zNear, double zFar)
fov
- the field of view.zNear
- the near clipping plan.zFar
- the far clipping plan.public void ortho(double left, double right, double bottom, double top, double near, double far)
public void configureLenseMask(int samples, boolean jitter)
public Ray generateRay(int sampleNo, int time, float x, float y)
|
Bouncy Castle Rendering Toolkit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |