public class

Camera

extends Object
java.lang.Object
   ↳ casmi.graphics.object.Camera

Class Overview

Camera class. Wrap JOGL and make it easy to use. This class is similar to gluLookAt() in OpenGL

Summary

Public Constructors
Camera(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ)
Creates Camera object setting the eye position, the center of the scene and which axis is facing upward.
Camera()
Creates Camera object using default parameter.
Public Methods
double[] getCameraDirection()
Gets the eye direction of this Camera.
double getCenterX()
Returns the center of the scene of this Camera.
double getCenterY()
Returns the center of the scene of this Camera.
double getCenterZ()
Returns the center of the scene of this Camera.
double getEyeX()
Returns the x-coordinate of the eye position of this Camera.
double getEyeY()
Returns the y-coordinate of the eye position of this Camera.
double getEyeZ()
Returns the z-coordinate of the eye position of this Camera.
double getUpX()
double getUpY()
double getUpZ()
double[] getViewMatrix()
final static double[] getViewMatrix(double ex, double ey, double ez, double tx, double ty, double tz, double ux, double uy, double uz)
void render(Graphics g)
void set(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ)
Sets the eye position, the center of the scene and which axis is facing upward.
void setCenter(double centerX, double centerY, double centerZ)
Sets the center of the scene of this Camera.
void setCenterX(double centerX)
Sets the center of the scene of this Camera.
void setCenterY(double centerY)
Sets the center of the scene of this Camera.
void setCenterZ(double centerZ)
Sets the center of the scene of this Camera.
void setEye(double eyeX, double eyeY, double eyeZ)
Sets the eye position of this Camera.
void setEyeX(double eyeX)
Sets the x-coordinate of the eye position of this Camera.
void setEyeY(double eyeY)
Sets the y-coordinate of the eye position of this Camera.
void setEyeZ(double eyeZ)
Sets the z-coordinate of the eye position of this Camera.
void setOrientation(double upX, double upY, double upZ)
Sets which axis is facing upward.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Camera (double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ)

Creates Camera object setting the eye position, the center of the scene and which axis is facing upward.

Parameters
eyeX The x-coordinate for the eye.
eyeY The y-coordinate for the eye.
eyeZ The z-coordinate for the eye.
centerX The x-coordinate for the center of the scene.
centerY The y-coordinate for the center of the scene.
centerZ The z-coordinate for the center of the scene.
upX Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
upY Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
upZ Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.

public Camera ()

Creates Camera object using default parameter. The default values are camera(width/2.0, height/2.0, (height/2.0) / tan(PI*60.0 / 360.0), width/2.0, height/2.0, 0, 0, 1, 0)

Public Methods

public double[] getCameraDirection ()

Gets the eye direction of this Camera.

Returns
  • The eye direction.

public double getCenterX ()

Returns the center of the scene of this Camera.

Returns
  • The X-coordinate for the center of the scene.

public double getCenterY ()

Returns the center of the scene of this Camera.

Returns
  • The Y-coordinate for the center of the scene.

public double getCenterZ ()

Returns the center of the scene of this Camera.

Returns
  • The Z-coordinate for the center of the scene.

public double getEyeX ()

Returns the x-coordinate of the eye position of this Camera.

Returns
  • The x-coordinate for the eye.

public double getEyeY ()

Returns the y-coordinate of the eye position of this Camera.

Returns
  • The y-coordinate for the eye.

public double getEyeZ ()

Returns the z-coordinate of the eye position of this Camera.

Returns
  • The z-coordinate for the eye.

public double getUpX ()

public double getUpY ()

public double getUpZ ()

public double[] getViewMatrix ()

public static final double[] getViewMatrix (double ex, double ey, double ez, double tx, double ty, double tz, double ux, double uy, double uz)

public void render (Graphics g)

public void set (double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ)

Sets the eye position, the center of the scene and which axis is facing upward.

Parameters
eyeX The x-coordinate for the eye.
eyeY The y-coordinate for the eye.
eyeZ The z-coordinate for the eye.
centerX The x-coordinate for the center of the scene.
centerY The y-coordinate for the center of the scene.
centerZ The z-coordinate for the center of the scene.
upX Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
upY Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
upZ Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.

public void setCenter (double centerX, double centerY, double centerZ)

Sets the center of the scene of this Camera.

Parameters
centerX The x-coordinate for the center of the scene.
centerY The y-coordinate for the center of the scene.
centerZ The z-coordinate for the center of the scene.

public void setCenterX (double centerX)

Sets the center of the scene of this Camera.

Parameters
centerX The X-coordinate for the center of the scene.

public void setCenterY (double centerY)

Sets the center of the scene of this Camera.

Parameters
centerY The Y-coordinate for the center of the scene.

public void setCenterZ (double centerZ)

Sets the center of the scene of this Camera.

Parameters
centerZ The Z-coordinate for the center of the scene.

public void setEye (double eyeX, double eyeY, double eyeZ)

Sets the eye position of this Camera.

Parameters
eyeX The x-coordinate for the eye.
eyeY The y-coordinate for the eye.
eyeZ The z-coordinate for the eye.

public void setEyeX (double eyeX)

Sets the x-coordinate of the eye position of this Camera.

Parameters
eyeX The x-coordinate for the eye.

public void setEyeY (double eyeY)

Sets the y-coordinate of the eye position of this Camera.

Parameters
eyeY The y-coordinate for the eye.

public void setEyeZ (double eyeZ)

Sets the z-coordinate of the eye position of this Camera.

Parameters
eyeZ The z-coordinate for the eye.

public void setOrientation (double upX, double upY, double upZ)

Sets which axis is facing upward.

Parameters
upX Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
upY Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.
upZ Setting which axis is facing upward; usually 0.0, 1.0, or -1.0.