|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Camera
Title: Camera
Description: This class provides access to the position of the camera, its focus point and its distance to the projection screen that are used to view the 3D scenes. The camera can also be rotated around the line of sight (i.e. the line which conects the camera with the focus point).
The camera position can be set using either the desired X,Y,Z coordinates or spherical coordinates around the focus point. This makes it easy to rotate the scene both horizontally and vertically (around the focus).
Panning can be achieved by moving the focus point to one side.
Zooming is done increasing (positive zoom) or decreasing the distance between the camera and the projection screen.
The projection screen is always normal to the line of sight and has its origin at the intersection of this line with the screen itself.
The camera provides fives different modes of projecting points in space to the screen. Two modes are truly three-dimensional. The other three are planar modes.
setProjectionMode(int)
Nested Class Summary | |
---|---|
static class |
Camera.Loader
|
Field Summary | |
---|---|
static int |
MODE_NO_PERSPECTIVE
|
static int |
MODE_PERSPECTIVE
|
static int |
MODE_PLANAR_XY
|
static int |
MODE_PLANAR_XZ
|
static int |
MODE_PLANAR_YZ
|
Method Summary | |
---|---|
void |
copyFrom(Camera camera)
Copies its configuration from another camera |
double |
getAltitude()
Get the elevation (vertical) angle of the camera position in spherical coordinates with respect to the focus point. |
double |
getAzimuth()
Get the horizontal angle of the camera position in spherical coordinates with respect to the focus point. |
double |
getDistanceToScreen()
Returns the distance from the camera to the projecting screen. |
double |
getFocusX()
Returns the focus X coordinate |
double |
getFocusY()
Returns the focus Y coordinate |
double |
getFocusZ()
Returns the focus Z coordinate |
int |
getProjectionMode()
Gets the projecting mode of the camera. |
double |
getRotation()
Returns the angle that the camera is rotated along the line of sight. |
Transformation |
getTransformation()
Returns the transfomation used to project (x,y,z) points in space to points of the form (a,b,distance). |
double |
getX()
Returns the camera X coordinate |
double |
getY()
Returns the camera Y coordinate |
double |
getZ()
Returns the camera Z coordinate |
void |
reset()
Resets the camera to the default. |
void |
setAltitude(double angle)
Set the elevation (vertical) angle of the camera position in spherical coordinates with respect to the focus point. |
void |
setAzimuth(double angle)
Set the azimuthal (horizontal) angle of the camera position in spherical coordinates with respect to the focus point. |
void |
setAzimuthAndAltitude(double azimuth,
double altitude)
Set the angles of the camera position in spherical coordinates with respect to the focus point. |
void |
setDistanceToScreen(double distance)
Sets the distance from the camera to the projecting screen. |
void |
setFocusXYZ(double[] point)
Sets the focus of the camera. |
void |
setFocusXYZ(double x,
double y,
double z)
Sets the focus point of the camera. |
void |
setProjectionMode(int mode)
Sets one of the projecting modes. |
void |
setRotation(double angle)
Sets the angle that the camera is rotated along the line of sight. |
void |
setXYZ(double[] point)
Sets the position of the camera. |
void |
setXYZ(double x,
double y,
double z)
Sets the position of the camera. |
Field Detail |
---|
static final int MODE_PLANAR_XY
static final int MODE_PLANAR_XZ
static final int MODE_PLANAR_YZ
static final int MODE_NO_PERSPECTIVE
static final int MODE_PERSPECTIVE
Method Detail |
---|
void setProjectionMode(int mode)
Changing the mode does not reset the camera.
mode
- intint getProjectionMode()
void reset()
void setXYZ(double x, double y, double z)
x
- doubley
- doublez
- doublevoid setXYZ(double[] point)
point
- double[]double getX()
double getY()
double getZ()
void setFocusXYZ(double x, double y, double z)
x
- doubley
- doublez
- doublevoid setFocusXYZ(double[] point)
point
- double[]double getFocusX()
double getFocusY()
double getFocusZ()
void setRotation(double angle)
angle
- double The angle in radiansdouble getRotation()
void setDistanceToScreen(double distance)
distance
- doubledouble getDistanceToScreen()
void setAzimuth(double angle)
angle
- the desired angle in radiansdouble getAzimuth()
void setAltitude(double angle)
angle
- the desired angle in radians in the range [-Math.PI/2,Math.PI/2]double getAltitude()
void setAzimuthAndAltitude(double azimuth, double altitude)
azimuth
- the desired azimuthal angle in radiansaltitude
- the desired altitude angle in radians in the range [-Math.PI/2,Math.PI/2]Transformation getTransformation()
void copyFrom(Camera camera)
camera
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |