Class Eye

java.lang.Object
  |
  +--Eye

class Eye
extends java.lang.Object

Author:
Erhan Oztop, 2001-2002

Source code by Erhan Oztop (erhan@atr.co.jp)
Copyright August 2002 via
University of Southern California Ph.D. publication copyright
Class for the camera(or eye). For now camera can be on the Z axis.

Field Summary
(package private)  Point3d Fpos
          Position of eye
(package private)  Point3d lock
           
(package private)  double Mag
          Screen scale
(package private)  Point3d resF
           
(package private)  Point3d resX
           
(package private)  Point3d resY
           
(package private)  Point3d resZ
           
(package private)  Point3d X
          Eye coordinate axis
(package private)  Point3d Y
          Eye coordinate axis
(package private)  Point3d Z
          Eye coordinate axis
 
Constructor Summary
Eye(double flen, double mag)
           
 
Method Summary
 void _project(Point3d p, java.awt.Point r)
          Project point p and store the projection in r.
 void adjustViewPlane(int dx, int dy)
           
 Point3d align(Point3d p, Point3d rot)
           
 double getMag()
           
 void lock(double x, double y, double z)
           
 void lookAt(double x, double y, double z)
           
 void lookAt(Point3d p)
          Construct a new eye coord.
 void printinner(java.lang.String s)
           
 java.awt.Point project(Point3d p)
          Project point p and return the projection as a Point.
 double projectDist(Point3d p1, Point3d p2)
           
 void reset()
           
 void rotateViewPlane(Point3d L, double T)
           
 void setMag(double newmag)
           
 void setPosition(double x, double y, double z)
           
 Point3d toWorld(Point3d r)
           
 void unlock()
           
 void XrotateViewPlane(double T)
           
 void YrotateViewPlane(double T)
           
 void ZrotateViewPlane(double T)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

Fpos

Point3d Fpos
Position of eye

X

Point3d X
Eye coordinate axis

Y

Point3d Y
Eye coordinate axis

Z

Point3d Z
Eye coordinate axis

resX

Point3d resX

resY

Point3d resY

resZ

Point3d resZ

resF

Point3d resF

Mag

double Mag
Screen scale

lock

Point3d lock
Constructor Detail

Eye

public Eye(double flen,
           double mag)
Method Detail

reset

public void reset()

getMag

public double getMag()

setMag

public void setMag(double newmag)

printinner

public void printinner(java.lang.String s)

XrotateViewPlane

public void XrotateViewPlane(double T)

YrotateViewPlane

public void YrotateViewPlane(double T)

ZrotateViewPlane

public void ZrotateViewPlane(double T)

rotateViewPlane

public void rotateViewPlane(Point3d L,
                            double T)

align

public Point3d align(Point3d p,
                     Point3d rot)

project

public java.awt.Point project(Point3d p)
Project point p and return the projection as a Point. The projection is done as for instance for x coordinate the projected x coordinate is F*x/(z-Fz). -This projection is redundant and will be replaced by a simpler form-

_project

public void _project(Point3d p,
                     java.awt.Point r)
Project point p and store the projection in r. The projection is done as for instance for x coordinate the projected x coordinate is F*x/(z-Fz). -This projection is redundant and will be replaced by a simpler form-

toWorld

public Point3d toWorld(Point3d r)

adjustViewPlane

public void adjustViewPlane(int dx,
                            int dy)

projectDist

public double projectDist(Point3d p1,
                          Point3d p2)

setPosition

public void setPosition(double x,
                        double y,
                        double z)

lookAt

public void lookAt(Point3d p)
Construct a new eye coord. system so that p is centered. Note that there are infinitely many of these systems. Here we pick the one that will have same orientation as the world y-axis if the direction given is (0,0,1).

lookAt

public void lookAt(double x,
                   double y,
                   double z)

lock

public void lock(double x,
                 double y,
                 double z)

unlock

public void unlock()