de.grogra.billboard
Class RotationCamera

java.lang.Object
  extended by de.grogra.billboard.RotationCamera

public class RotationCamera
extends java.lang.Object

This is an implementation to rotate the camera around an axis by a given distance and a given angle.

Author:
adgen

Constructor Summary
RotationCamera()
           
 
Method Summary
 TMatrix4d calculateMatrix(double angle)
          This calculate a new matrix depending on angle and the initial matrix of the camera.
 View3D getView3D()
          Gets the view3d
 void lookUpAndDown(double angle)
          If the camera has to look up or look down, just invoke this method.
 void makeParallel()
          Makes the projection of the camera parallel.
 void makePerspective()
          Makes the projection of the camera perspective.
 void moveAroundZ(double angle)
          Just invoke calculateMatrix(double) and set the transformation of the camera.
 void setDistance(double dist, double zOffset)
          Sets the height and the distance to worlds origin of the camera.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotationCamera

public RotationCamera()
Method Detail

calculateMatrix

public TMatrix4d calculateMatrix(double angle)
This calculate a new matrix depending on angle and the initial matrix of the camera.

Parameters:
angle - Value of the Rotation.
Returns:
Transformation-Matrix of the camera.

getView3D

public View3D getView3D()
Gets the view3d

Returns:
The used view3d-object.

lookUpAndDown

public void lookUpAndDown(double angle)
If the camera has to look up or look down, just invoke this method. This method rotate the camera around the local x-axis.

Parameters:
angle - Rotate the Camera around local x-axis.

makeParallel

public void makeParallel()
Makes the projection of the camera parallel.


makePerspective

public void makePerspective()
Makes the projection of the camera perspective.


moveAroundZ

public void moveAroundZ(double angle)
Just invoke calculateMatrix(double) and set the transformation of the camera.

Parameters:
anglePerStep - Value for one step of rotation.
step - Number of current step.

setDistance

public void setDistance(double dist,
                        double zOffset)
Sets the height and the distance to worlds origin of the camera.

Parameters:
dist - Distance to the coordinates origin on.
zOffset - Height of the camera over the ground.