NAME
vtkCamera - a virtual camera for 3D rendering
SYNOPSIS
#include "/opt/vtk-c++/graphics/vtkCamera.h"
class VTK_EXPORT vtkCamera : public vtkObject
vtkCamera();
void PrintSelf(ostream& os, vtkIndent indent);
static vtkCamera *New();
const char *GetClassName() {return "vtkCamera";};
void SetPosition(float x, float y, float z);
void SetPosition(float a[3]);
float *GetPosition();
void GetPosition(float data[3]);
void SetFocalPoint(float x, float y, float z);
void SetFocalPoint(float a[3]);
float *GetFocalPoint();
void GetFocalPoint(float data[3]);
void SetViewUp(float vx, float vy, float vz);
void SetViewUp(float a[3]);
float *GetViewUp();
void GetViewUp(float data[3]);
void SetClippingRange(float front, float back);
void SetClippingRange(float a[2]);
float *GetClippingRange();
void GetClippingRange(float data[2]);
virtual void Render(vtkRenderer *) {};
void SetViewAngle( float angle );
float GetViewAngle();
void SetEyeAngle(float);
float GetEyeAngle();
int GetStereo();
void SetWindowCenter( float x, float y );
float *GetWindowCenter();
void GetWindowCenter(float data[2]);
void SetParallelScale( float scale );
float GetParallelScale();
void SetFocalDisk(float);
float GetFocalDisk();
void SetLeftEye(int);
int GetLeftEye();
void SetThickness(float);
float GetThickness();
void SetDistance(float);
float GetDistance();
void SetParallelProjection( int flag )
{
if ( ParallelProjection != flag )
{
ParallelProjection = flag;
this->Modified();
this->ViewingRaysModified();
}
}
int GetParallelProjection();
void ParallelProjectionOn();
void ParallelProjectionOff();
void SetViewPlaneNormal(float a[3]);
void SetViewPlaneNormal(float x, float y, float z);
void ComputeViewPlaneNormal();
void ComputeDistance();
void ComputeViewTransform();
void ComputePerspectiveTransform(float aspect, float nearz, float farz);
vtkMatrix4x4 &GetViewTransform();
vtkMatrix4x4 &GetPerspectiveTransform(float aspect,
float nearz, float farz);
vtkMatrix4x4 &GetCompositePerspectiveTransform(float aspect,
float nearz, float farz);
float *GetViewPlaneNormal();
void GetViewPlaneNormal(float data[3]);
void SetRoll(float);
void Roll(float);
float GetRoll();
void Zoom(float);
void Dolly(float);
void Azimuth(float);
void Yaw(float);
void Elevation(float);
void Pitch(float);
void OrthogonalizeViewUp();
float *GetOrientation();
float *GetOrientationWXYZ();
unsigned long int GetViewingRaysMTime();
SUMMARY
float *GetPosition()
void GetPosition(float data[3])
Set/Get the position of the camera in world coordinates.
float *GetFocalPoint()
void GetFocalPoint(float data[3])
Set/Get the focal point of the camera in world coordinates
float *GetViewUp()
void GetViewUp(float data[3])
Set/Get the view up direction for the camera.
float *GetClippingRange()
void GetClippingRange(float data[2])
Set/Get the location of the front and back clipping planes along the direction of projection. These are positive distances along the direction of projection. How these values are set can have a large impact on how well z-buffering works. In particular the front clipping plane can make a very big difference. Setting it to 0.01 when it really could be 1.0 can have a big impact on your z-buffer resolution farther away.
virtual void Render(vtkRenderer *) {};
This method causes the camera to set up whatever is required for viewing the scene. This is actually handled by an subclass of vtkCamera, which is created through New()
void SetViewAngle(float)
Set/Get the camera view angle (i.e., the width of view in degrees). Larger values yield greater perspective distortion.
void SetEyeAngle(float)
Set/Get the separation between eyes (in degrees). This is used when generating stereo images.
int GetStereo()
Is this camera rendering in stereo?
void SetWindowCenter(float, float)
void SetWindowCenter(float *)
Set/Get the center of the window.
void SetParallelScale(float)
Set/Get the scaling used for a parallel projection.
void SetFocalDisk(float)
Set the size of the cameras lens in world coordinates. This is only used when the renderer is doing focal depth rendering. When that is being done the size of the focal disk will effect how significant the depth effects will be.
void SetParallelProjection(int)
Set/Get the value of the ParallelProjection instance variable. This determines if the camera should do a perspective or parallel projection.
vtkCamera()
Construct camera instance with its focal point at the origin, and position=(0,0,1). The view up is along the y-axis, view angle is 30 degrees, and the clipping range is (.1,1000).
void SetThickness(float X)
Set the distance between clipping planes. A side effect of this method is to adjust the back clipping plane to be equal to the front clipping plane plus the thickness.
void SetDistance(float X)
Set the distance of the focal point from the camera. The focal point is modified accordingly. This should be positive.
void ComputeViewPlaneNormal()
Compute the view plane normal from the position and focal point.
void SetRoll(float roll)
Set the roll angle of the camera about the view plane normal.
float GetRoll()
Returns the roll of the camera.
void ComputeDistance ()
Compute the camera distance, which is the distance between the focal point and position.
float *GetOrientation ()
Returns the orientation of the camera. This is a vector of X,Y and Z rotations that when performed in the order RotateZ, RotateX, and finally RotateY, will yield the same 3x3 rotation matrix for the camera.
float *GetOrientationWXYZ()
Returns the WXYZ orientation of the camera.
void ComputeViewTransform()
Compute the view transform matrix. This is used in converting between view and world coordinates. It does not include any perspective effects but it does include shearing and scaling.
void ComputePerspectiveTransform(float aspect, float nearz, float farz)
Compute the perspective transform matrix. This is used in converting between view and world coordinates.
vtkMatrix4x4 &GetPerspectiveTransform(float aspect, float nearz, float farz)
Return the perspective transform matrix. See ComputePerspectiveTransform.
vtkMatrix4x4 &GetViewTransform()
Return the perspective transform matrix. See ComputePerspectiveTransform.
vtkMatrix4x4 &GetCompositePerspectiveTransform(float aspect,
void Dolly(float amount)
Move the position of the camera along the view plane normal. Moving towards the focal point (e.g., > 1) is a dolly-in, moving away from the focal point (e.g., < 1) is a dolly-out.
void Zoom(float amount)
Change the ViewAngle of the camera so that more or less of a scene occupies the viewport. A value > 1 is a zoom-in. A value < 1 is a zoom-out.
void Azimuth (float angle)
Rotate the camera about the view up vector centered at the focal point.
void Elevation (float angle)
Rotate the camera about the cross product of the view plane normal and the view up vector centered on the focal point.
void Yaw (float angle)
Rotate the focal point about the view up vector centered at the camera's position.
void Pitch (float angle)
Rotate the focal point about the cross product of the view up vector and the view plane normal, centered at the camera's position.
void Roll (float angle)
Rotate the camera around the view plane normal.
void SetViewPlaneNormal(float X,float Y,float Z)
Set the direction that the camera points. Adjusts position to be consistent with the view plane normal.