Package cz.fidentis.analyst.rendering
Class Camera
java.lang.Object
cz.fidentis.analyst.rendering.Camera
- All Implemented Interfaces:
Animatable
,Serializable
OpenGL code related to the camera.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
FOVY in degreesstatic final javax.vecmath.Vector3f
static final double
When the proper distance of the camera is found based on scene bounding box, the objects may be unnecessary small.static final float
static final float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Constructs a deep copy of the camera.javax.vecmath.Vector3d
Returns center of the scene.javax.vecmath.Vector3d
Returns camera position.javax.vecmath.Vector3d
Returns camera orientation (the up direction).void
move
(double xShift, double yShift) Moves the camera.void
rotate
(double xAngle, double yAngle) Rotates object around axes that appear as horizontal and vertical axes on the screen (parallel to the screen edges), intersecting at the center of the screen (i.e., head center).javax.vecmath.Vector3d
rotateAroundAxis
(javax.vecmath.Tuple3d point, javax.vecmath.Vector3d u, double angle) Calculate the new position f point from given angle and rotation axis.void
rotateDown
(double degree) Rotates the camera down.void
rotateLeft
(double degree) Rotates the camera left.void
rotateRight
(double degree) Rotates the camera right.void
rotateUp
(double degree) Rotates the camera up.toString()
void
Animation step.void
zoomIn
(double distance) Zooms in.void
zoomOut
(double distance) Zooms out.void
Zooms the camera to fit the given bounding boxvoid
Zooms the camera to fit all human faces in the scenevoid
zoomToFitPerpendicular
(Box bbox, javax.vecmath.Vector3d normal) Zooms the camera to fit the given bounding box, perpendicular to the normal
-
Field Details
-
FIELD_OF_VIEW
public static final int FIELD_OF_VIEWFOVY in degrees- See Also:
-
Z_NEAR
public static final float Z_NEAR- See Also:
-
Z_FAR
public static final float Z_FAR- See Also:
-
POSITION
public static final javax.vecmath.Vector3f POSITION -
SCALE_FACTOR
public static final double SCALE_FACTORWhen the proper distance of the camera is found based on scene bounding box, the objects may be unnecessary small. This zooms them in.- See Also:
-
-
Constructor Details
-
Camera
public Camera()
-
-
Method Details
-
zoomToFit
Zooms the camera to fit all human faces in the scene- Parameters:
scene
- a scene
-
copy
Constructs a deep copy of the camera.- Returns:
- deep copy of the camera
-
zoomToFit
Zooms the camera to fit the given bounding box- Parameters:
bbox
- a bounding box
-
zoomToFitPerpendicular
Zooms the camera to fit the given bounding box, perpendicular to the normal- Parameters:
bbox
- a bounding boxnormal
- a normal
-
getCenter
public javax.vecmath.Vector3d getCenter()Returns center of the scene.- Returns:
- center of the scene.
-
getPosition
public javax.vecmath.Vector3d getPosition()Returns camera position.- Returns:
- camera position.
-
getUpDirection
public javax.vecmath.Vector3d getUpDirection()Returns camera orientation (the up direction).- Returns:
- camera orientation (the up direction).
-
rotateUp
public void rotateUp(double degree) Rotates the camera up.- Parameters:
degree
- degree of rotation
-
rotateDown
public void rotateDown(double degree) Rotates the camera down.- Parameters:
degree
- degree of rotation
-
rotateLeft
public void rotateLeft(double degree) Rotates the camera left.- Parameters:
degree
- degree of rotation
-
rotateRight
public void rotateRight(double degree) Rotates the camera right.- Parameters:
degree
- degree of rotation
-
rotate
public void rotate(double xAngle, double yAngle) Rotates object around axes that appear as horizontal and vertical axes on the screen (parallel to the screen edges), intersecting at the center of the screen (i.e., head center).- Parameters:
xAngle
- angle around vertical axis on the screenyAngle
- angle around horizontal axis on the screen
-
move
public void move(double xShift, double yShift) Moves the camera.- Parameters:
xShift
- xShiftyShift
- yShift
-
rotateAroundAxis
public javax.vecmath.Vector3d rotateAroundAxis(javax.vecmath.Tuple3d point, javax.vecmath.Vector3d u, double angle) Calculate the new position f point from given angle and rotation axis.- Parameters:
point
- original positionu
- vector of rotation axisangle
- angle of rotation- Returns:
- new position
-
zoomIn
public void zoomIn(double distance) Zooms in.- Parameters:
distance
- Distance to be zoom in
-
zoomOut
public void zoomOut(double distance) Zooms out.- Parameters:
distance
- Distance to be zoom out
-
transform
Description copied from interface:Animatable
Animation step.- Specified by:
transform
in interfaceAnimatable
- Parameters:
dir
- Transformation direction
-
toString
-