org.fixbin.ddd
Class Camera

java.lang.Object
  extended byCanvas
      extended byorg.fixbin.ddd.Camera
Direct Known Subclasses:
CubeCam

public class Camera
extends Canvas

This class represents a Camera, which views objects through a "window" The default camera is positioned at x=0, y=0, z=-10 with its view direction towards the origin (basically all view axis are identical/parallel to the "universe" axes.
You can also use the special constructor to initialize the camera position and view direction.

See Also:
Serialized Form

Field Summary
protected  long centerX
           
protected  long centerY
           
 Point pos
           
 long scrDist
           
 Matrix33 view
           
 
Constructor Summary
Camera()
          Creates a new (default) instance of Camera
Camera(long posX, long posY, long posZ, long dir00, long dir01, long dir02, long dir10, long dir11, long dir12, long dir20, long dir21, long dir22, long centerX, long centerY, long scrDist)
          Creates a new instance of Camera with predefined position and direction
 
Method Summary
 void addObject(Object3D object)
          Add an object to the camera
 void addPoint(Point p)
          Add a single point
 void calculate()
          Renders all objects (should be called before displaying) !!!
protected  void paint(Graphics g)
          Draw the content of the camera
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pos

public Point pos

view

public Matrix33 view

centerX

protected long centerX

centerY

protected long centerY

scrDist

public long scrDist
Constructor Detail

Camera

public Camera()
Creates a new (default) instance of Camera


Camera

public Camera(long posX,
              long posY,
              long posZ,
              long dir00,
              long dir01,
              long dir02,
              long dir10,
              long dir11,
              long dir12,
              long dir20,
              long dir21,
              long dir22,
              long centerX,
              long centerY,
              long scrDist)
Creates a new instance of Camera with predefined position and direction

Parameters:
posX -
posY -
posZ -
dir00 -
dir01 -
dir02 -
dir10 -
dir11 -
dir12 -
dir20 -
dir21 -
dir22 -
centerX -
centerY -
scrDist -
Method Detail

addObject

public void addObject(Object3D object)
Add an object to the camera

Parameters:
object - (Object3D) the new object

addPoint

public void addPoint(Point p)
Add a single point

Parameters:
p - (Point)

calculate

public void calculate()
Renders all objects (should be called before displaying) !!!


paint

protected void paint(Graphics g)
Draw the content of the camera