Class Camera

java.lang.Object
cz.fidentis.analyst.rendering.Camera
All Implemented Interfaces:
Animatable, Serializable

public class Camera extends Object implements Animatable, Serializable
OpenGL code related to the camera.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    FOVY in degrees
    static 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
     
    void
    Animation step.
    void
    zoomIn(double distance)
    Zooms in.
    void
    zoomOut(double distance)
    Zooms out.
    void
    zoomToFit(Box bbox)
    Zooms the camera to fit the given bounding box
    void
    Zooms the camera to fit all human faces in the scene
    void
    zoomToFitPerpendicular(Box bbox, javax.vecmath.Vector3d normal)
    Zooms the camera to fit the given bounding box, perpendicular to the normal

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • FIELD_OF_VIEW

      public static final int FIELD_OF_VIEW
      FOVY 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_FACTOR
      When 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

      public void zoomToFit(Scene scene)
      Zooms the camera to fit all human faces in the scene
      Parameters:
      scene - a scene
    • copy

      public Camera copy()
      Constructs a deep copy of the camera.
      Returns:
      deep copy of the camera
    • zoomToFit

      public void zoomToFit(Box bbox)
      Zooms the camera to fit the given bounding box
      Parameters:
      bbox - a bounding box
    • zoomToFitPerpendicular

      public void zoomToFitPerpendicular(Box bbox, javax.vecmath.Vector3d normal)
      Zooms the camera to fit the given bounding box, perpendicular to the normal
      Parameters:
      bbox - a bounding box
      normal - 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 screen
      yAngle - angle around horizontal axis on the screen
    • move

      public void move(double xShift, double yShift)
      Moves the camera.
      Parameters:
      xShift - xShift
      yShift - 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 position
      u - vector of rotation axis
      angle - 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

      public void transform(AnimationDirection dir)
      Description copied from interface: Animatable
      Animation step.
      Specified by:
      transform in interface Animatable
      Parameters:
      dir - Transformation direction
    • toString

      public String toString()
      Overrides:
      toString in class Object