Example #1
0
  /**
   * Constructs a new camera.
   *
   * @param position The position of the camera
   * @param look The direction the camera is looking
   * @param up The "up" direction for the camera
   */
  public Camera(Vector3d position, Vector3d look, Vector3d up) {
    m_position = position;

    m_nVector = look;
    m_nVector.normalize();

    m_vVector = up;
    m_vVector.normalize();

    m_uVector = m_vVector.cross(m_nVector).normalize();
  }
Example #2
0
 /**
  * Moves the camera by the specified displacement in the v direction.
  *
  * @param delta The displacement by which to move
  */
 public void move_v(double delta) {
   m_position = Vector3d.scale_add(delta, m_vVector, m_position);
 }