JavaView® v2.12

jv.project
Interface PvCameraIf

All Superinterfaces:
PsUpdateIf
All Known Implementing Classes:
PvCamera

public interface PvCameraIf
extends PsUpdateIf

This interface must be implemented by all cameras.

Version:
29.04.01, 1.60 revised (kp) New method setProjectionMode added.
15.03.01, 1.50 revised (kp) Now interface extends PsUpdateIf.
15.03.01, 1.40 revised (kp) Methods for horizontal clipping added.
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.
 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.
 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.
 void setDist(double newDist)
          Set distance of camera position from point of interest in world coordinates.
 void setEnabledClip(boolean flag)
          Enable horizontal clipping.
 void setFarClip(double dist)
          Get distance of far clipping plane.
 void setFieldOfView(double angle)
          Set opening angle of camera.
 void setInterest(PdVector pos)
          Set position at which camera is directed, i.e. the point of interest.
 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 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.
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent, update
 

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

setProjectionMode

public void setProjectionMode(int mode)
Set projection mode of the camera, for example, perspective, xy-projection etc. For a list of possible type see PvDisplayIf#CAMERA_ORTHO_XY.
Parameters:
new - 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)

getFieldOfView

public double getFieldOfView()
Get opening angle of camera.
Returns:
angle in (0,180)
See Also:
setFieldOfView(double)

setFieldOfView

public void setFieldOfView(double angle)
Set opening angle of camera.
Parameters:
angle - in (0,180)
See Also:
getFieldOfView()

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.

isEnabledClip

public boolean isEnabledClip()
Determine whether horizontal clipping is enabled.

setEnabledClip

public void setEnabledClip(boolean flag)
Enable horizontal clipping.

getNearClip

public double getNearClip()
Get distance of the near clipping plane. The near and far clipping planes of a camera are orthogonal to the viewing direction at a positive distance. The near clip plane is closer to the camera than the far clip plane, and this order is not allowed to change.
Returns:
positive distance of the near clip plane

setNearClip

public void setNearClip(double dist)
Get distance of the near clipping plane. The near and far clipping planes of a camera are orthogonal to the viewing direction at a positive distance. The near clip plane is closer to the camera than the far clip plane, and this order is not allowed to change.
Parameters:
dist - positive distance of the near clip plane

getFarClip

public double getFarClip()
Get distance of the far clipping plane. The near and far clipping planes of a camera are orthogonal to the viewing direction at a positive distance. The near clip plane is closer to the camera than the far clip plane, and this order is not allowed to change.
Returns:
positive distance of the far clip plane

setFarClip

public void setFarClip(double dist)
Get distance of far clipping plane. The near and far clipping planes of a camera are orthogonal to the viewing direction at a positive distance. The near clip plane is closer to the camera than the far clip plane, and this order is not allowed to change.
Parameters:
dist - positive distance of the far clip plane

JavaView® v2.12

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