public interface PvCameraIf extends PsUpdateIf
Modifier and Type | Field and Description |
---|---|
static int |
CAMERA_MODEL
Misused camera type in display, simulates transformation of modeling matrix of geometry.
|
static java.lang.String[] |
CAMERA_NAME
Array of camera names.
|
static int |
CAMERA_ORTHO_XY
Camera type and projection mode projecting orthogonally onto xy-plane.
|
static int |
CAMERA_ORTHO_XZ
Camera type and projection mode projecting orthogonally onto xz-plane.
|
static int |
CAMERA_ORTHO_YZ
Camera type and projection mode projecting orthogonally onto yz-plane.
|
static int |
CAMERA_PERSPECTIVE
Camera type and projection mode allowing to arbitrary rotate camera.
|
Modifier and Type | Method and Description |
---|---|
double |
getDist()
Get distance of camera position from point of interest in world coordinates.
|
double |
getFarClip()
Get distance of the far clipping plane.
|
double |
getFieldOfView()
Get opening angle of camera.
|
PdVector |
getInterest()
Get position at which camera is directed, i.e. the point of interest.
|
double |
getNearClip()
Get distance of the near clipping plane.
|
PdVector |
getPosition()
Get position of camera in world coordinates.
|
int |
getProjectionMode()
Get projection mode of the camera, for example, perspective, xy-projection etc.
|
double |
getRoll()
Get angle which camera is rotated around viewing direction against default position.
|
double |
getScale()
Get zoom factor of camera.
|
PdMatrix |
getTransMatrix(int type)
Get transformation matrices PV, P, V and their inverses in current camera and display.
|
PdVector |
getUpVector()
Get up vector as second row of viewing matrix divided by scaling factor.
|
PdVector |
getViewDir()
Get normalized viewing direction which is the vector pointing from the camera
to its interest.
|
boolean |
isEnabledClip()
Determine whether horizontal clipping is enabled.
|
boolean |
isEnabledSceneRatio()
Check of aspect ratio of scene bounding box is enabled.
|
void |
saveAsDefault()
Save the current transformation matrices as default.
|
void |
setBoxRatio(PdVector ratio)
Set the scaling factor for all three camera axis to produce a non-square
viewing frustum.
|
void |
setDist(double newDist)
Set distance of camera position from point of interest in world coordinates.
|
void |
setEnabledBoxRatio(boolean flag)
Enable usage of a variable aspect ratio for the viewing frustum of this camera.
|
void |
setEnabledClip(boolean flag)
Enable horizontal clipping.
|
void |
setEnabledSceneRatio(boolean flag)
Set aspect ratio of scene bounding box.
|
void |
setFarClip(double dist)
Get distance of far clipping plane.
|
void |
setFieldOfView(double angle)
Set opening angle of camera.
|
void |
setFullPosition(PdVector interest,
PdVector position,
PdVector upDir)
Set full orientation and location of camera in world coordinates.
|
void |
setInterest(PdVector pos)
Set position at which camera is directed, i.e. the point of interest.
|
void |
setName(java.lang.String name)
Set name of instance.
|
void |
setNearClip(double dist)
Get distance of the near clipping plane.
|
void |
setPosition(PdVector pos)
Set position of camera in world coordinates.
|
void |
setProjectionMode(int mode)
Set projection mode of the camera, for example, perspective, xy-projection etc.
|
void |
setRoll(double roll)
Set angle which camera is rotated around viewing direction against default position.
|
void |
setScale(double newScale)
Set zoom factor of camera.
|
void |
setTransMatrix(int type,
PdMatrix mat)
Set transformation matrices PV, P, V and their inverses in current camera and display.
|
void |
setUpVector(PdVector up)
Set normalized up vector of camera in world coordinates.
|
void |
setViewDir(PdVector pos)
Set viewing direction as the vector pointing from the camera
to its interest.
|
getFather, getName, setParent, update
static final int CAMERA_PERSPECTIVE
static final int CAMERA_ORTHO_XY
static final int CAMERA_ORTHO_XZ
static final int CAMERA_ORTHO_YZ
static final int CAMERA_MODEL
static final java.lang.String[] CAMERA_NAME
void setName(java.lang.String name)
void saveAsDefault()
int getProjectionMode()
PvCameraIf#CAMERA_ORTHO_XY
.PvDisplayIf
void setProjectionMode(int mode)
PvCameraIf#CAMERA_ORTHO_XY
.mode
- new projection modePvDisplayIf
PdVector getViewDir()
void setViewDir(PdVector pos)
pos
- viewing direction in world coordinatesdouble getDist()
getScale()
void setDist(double newDist)
factor=newDist/currDist
.newDist
- distance of camera to interest in world coordinates.setScale(double)
double getScale()
getDist()
void setScale(double newScale)
newScale
- zoom factor of camera.setDist(double)
double getFieldOfView()
setFieldOfView(double)
void setFieldOfView(double angle)
angle
- angle in (0,180)getFieldOfView()
double getRoll()
Mathematically, the roll is the angle between the two planes p1=(viewDir, defaultUpVector) and p2=(viewDir, upVector). The defaultUpVector depends on the projection mode, in xy-projection mode we have defaultUpVector=(0,1,0) since camera look down the negative z-axis and the positive y-axis is showing upward.
setRoll(double)
void setRoll(double roll)
roll
- angle in (-pi,pi)getRoll()
PdVector getInterest()
interest = viewInv[.][3]
void setInterest(PdVector pos)
pos
- 3d-coordinates of interest in world coordinates.PdVector getPosition()
position = interest - dist*viewDir.
void setPosition(PdVector pos)
position = interest - dist*viewDir.
pos
- 3d-position of camera in world coordinates.void setFullPosition(PdVector interest, PdVector position, PdVector upDir)
position = interest - dist*viewDir.
UpDir must be orthogonal to the vector interest-position.
interest
- 3d-coordinates of point of interest in world coordinates.position
- 3d-coordinates of position of camera in world coordinates.upDir
- normalized up vector of camera in world coordinates.PdVector getUpVector()
upDir = -view[1][.] / getScale().
void setUpVector(PdVector up)
up
- normalized up vector of camera in world coordinates.boolean isEnabledClip()
void setEnabledClip(boolean flag)
double getNearClip()
void setNearClip(double dist)
dist
- positive distance of the near clip planedouble getFarClip()
boolean isEnabledSceneRatio()
void setEnabledSceneRatio(boolean flag)
void setEnabledBoxRatio(boolean flag)
void setBoxRatio(PdVector ratio)
ratio
- three scaling factors, default square has (1.,1.,1.).void setFarClip(double dist)
dist
- positive distance of the far clip planePdMatrix getTransMatrix(int type)
Modeling matrix should be set in original geometry model.
type
- type of transformation matrix, see PvDisplay.MATRIX_
void setTransMatrix(int type, PdMatrix mat)
Modeling matrix should be set in original geometry model.
type
- type of transformation matrix, see PvDisplay.MATRIX_
mat
- new transformation matrix"