JavaView® v2.00.008

jv.project
Interface PvCameraIf

All Known Implementing Classes:
PvCamera

public interface PvCameraIf

This interface must be implemented by all cameras.

Version:
25.07.00, 1.20 revised (kp) Some methods removed, documentation added.
25.07.00, 1.10 revised (kp) Interface renamed to PvCameraIf from PgCameraIf.
27.03.00, 1.00 created (ep)
Author:
Eike Preuss, Konrad Polthier

Method Summary
 double getDist()
          Get distance of camera position from point of interest in world coordinates.
 PdVector getInterest()
          Get position at which camera is directed, i.e. the point of interest.
 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.
 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.
 void setDist(double newDist)
          Set distance of camera position from point of interest in world coordinates.
 void setInterest(PdVector pos)
          Set position at which camera is directed, i.e. the point of interest.
 void setPosition(PdVector pos)
          Set position of camera in world coordinates.
 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 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.
 

Method Detail

getProjectionMode

public int getProjectionMode()
Get projection mode of the camera, for example, perspective, xy-projection etc. For a list of possible type see PvDisplayIf#CAMERA_ORTHO_XY.
Returns:
current projection mode
See Also:
PvDisplayIf

getViewDir

public PdVector getViewDir()
Get normalized viewing direction which is the vector pointing from the camera to its interest.
Returns:
normalized viewing direction in world coordinates

setViewDir

public void setViewDir(PdVector pos)
Set viewing direction as the vector pointing from the camera to its interest. Length of vector is irrelevant.
Parameters:
viewing - direction in world coordinates

getDist

public double getDist()
Get distance of camera position from point of interest in world coordinates. Distance is inverse to scaling factor of viewing matrix.
Returns:
distance of camera to interest in world coordinates.
See Also:
getScale()

setDist

public void setDist(double newDist)
Set distance of camera position from point of interest in world coordinates. Scale view matrix with factor=newDist/currDist.
Parameters:
distance - of camera to interest in world coordinates.
See Also:
setScale(double)

getScale

public double getScale()
Get zoom factor of camera.
Returns:
zoom factor of camera.
See Also:
getDist()

setScale

public void setScale(double newScale)
Set zoom factor of camera.
Parameters:
zoom - factor of camera.
See Also:
setDist(double)

getRoll

public double getRoll()
Get angle which camera is rotated around viewing direction against default position. The default position depends on the projection mode of the camera.

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 positiv y-axis is showing upward.

Returns:
angle in (-pi,pi)
See Also:
setRoll(double)

setRoll

public void setRoll(double roll)
Set angle which camera is rotated around viewing direction against default position. The default position depends on the projection mode of the camera.
Parameters:
angle - in (-pi,pi)
See Also:
getRoll()

getInterest

public PdVector getInterest()
Get position at which camera is directed, i.e. the point of interest. Interest is implicitly stores as the 4th column of the inverse viewing matrix.
interest = viewInv[.][3]
Returns:
3d-coordinates of interest in world coordinates.

setInterest

public void setInterest(PdVector pos)
Set position at which camera is directed, i.e. the point of interest.
Parameters:
pos - 3d-coordinates of interest in world coordinates.

getPosition

public PdVector getPosition()
Get position of camera in world coordinates. The camera position is implicitly stored and computed from
position = interest - dist*viewDir
.
Returns:
3d-position of camera in world coordinates.

setPosition

public void setPosition(PdVector pos)
Set position of camera in world coordinates. The camera position is implicitly stored by equation
position = interest - dist*viewDir
.
Parameters:
pos - 3d-position of camera in world coordinates.

getUpVector

public PdVector getUpVector()
Get up vector as second row of viewing matrix divided by scaling factor.
upDir = -view[1][.] / getScale()
.
Returns:
normalized up vector of camera in world coordinates.

setUpVector

public void setUpVector(PdVector up)
Set normalized up vector of camera in world coordinates.
Parameters:
normalized - up vector of camera in world coordinates.

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.