Class: TParallelCamera

Declaration: Cameras.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TLinkableCamera

Inherited By:

None.

Purpose:

TParallelCamera is a concrete class derived from TLinkableCamera. A parallel camera has no center of projection; the projectors never converge. (Projectors are straight lines connecting points in the scene with the corresponding points in the projection plane.) With a parallel camera, the size of the projected image is always the same regardless of the distances between the camera, the projection plane, and the 3-D scene. This behavior contrasts with that of the other concrete camera class, TPerspectiveCamera. TParallelCamera has the same set of member functions as TPerspectiveCamera--namely, the member functions provided by the base class, the functions Zoom and GetRay, and a series of setters.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TParallelCamera::TParallelCamera

  1. TParallelCamera ()
  2. TParallelCamera (const TGPoint3D & cameraPosition, const TGPoint3D & referencePoint, const TGPoint3D & upVector, GCoordinate viewDistance, GCoordinate nearViewPlaneDistance, GCoordinate farViewPlaneDistance, const TGPoint & projectionPoint =TGPoint :: kOrigin, const TGRect & cropWindow =TGRect :: kInfiniteRect)
  3. TParallelCamera (const TGPoint3D & cameraPosition, const TGPoint3D & referencePoint, GDegrees twistAngle, GCoordinate viewDistance, GCoordinate nearViewPlaneDistance, GCoordinate farViewPlaneDistance, const TGPoint & projectionPoint =TGPoint :: kOrigin, const TGRect & cropWindow =TGRect :: kInfiniteRect)
  4. TParallelCamera (const TGPoint3D & cameraPosition, const TGBox3D & boundingBox)
  5. TParallelCamera (const TParallelCamera & Camera)

Interface Category:

API.

Purpose:

  1. Default constructor. Initializes variables to their default values and updates the time stamp.
  2. Constructor that initializes the important variables with the values provided as arguments. This constructor uses the up vector object to provide the camera orientation.
  3. Constructor that initializes the important variables with the values provided as arguments. This constructor uses the twist angle object to provide the camera orientation.
  4. Constructor that gives a quick and easy way to see an object. By providing the constructor with the bounding box of the object you want to see, the values for the camera is set to look at the object. If the object falls outside of the near and far clipping windows (0.1 and 1000 units from the camera, respectively), then it is possible that some or all of the object will not be visible.
  5. Copy constructor.

Calling Context:

  1. Called by the stream-in operators. You can also call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Call this function directly.
  5. Called to copy an object. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws a Parameter Assert exception if either of near or far view-plane distances specified in constructor two or three is less than zero; or if the bounding box specified in constructor four is a kZeroBox or a kInfiniteBox.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::~TParallelCamera

virtual ~ TParallelCamera ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetPosition

virtual TGPoint3D GetPosition () const

Interface Category:

API.

Purpose:

Returns a TGPoint3D indicating the position of the camera.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGPoint3D object indicating the position of the camera.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetReferencePoint

virtual TGPoint3D GetReferencePoint () const

Interface Category:

API.

Purpose:

Returns the point that is aimed at by the camera.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGPoint3D object that is the point aimed at by the camera.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetUpVector

virtual TGPoint3D GetUpVector () const

Interface Category:

API.

Purpose:

Returns the up vector that defines the orientation of the camera. This vector is defined relative to the y-axis of the world coordinate system. A value of (0., 1., 0.) is considered upright.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGPoint3D object that is the up vector orientation of the camera.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetTwistAngle

virtual GDegrees GetTwistAngle () const

Interface Category:

API.

Purpose:

Returns the twist angle, which is measured counterclockwise about the z-axis. The twist angle also defines the orientation of the camera. However, if the camera is looking at the scene along a direction parallel to the y-axis, the twist angle is undefined, in which case you should use the up vector instead.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a GDegrees object that contains the twist angle of the camera.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetCropWindow

virtual TGRect GetCropWindow () const

Interface Category:

API.

Purpose:

Returns the area of interest within the viewfinder.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGRect object that specifies the area of interest within the viewfinder rectangle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetProjectionPoint

virtual TGPoint GetProjectionPoint () const

Interface Category:

API.

Purpose:

Returns the 2-D point where the 3-D origin is mapped to. The default is the center of the projection plane.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGPoint object that represents the 2-D origin of the image in the projection plane.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetViewDistance

virtual GCoordinate GetViewDistance () const

Interface Category:

API.

Purpose:

Returns the distance from the camera to the projection plane.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a GCoordinate object that represents the distance from the camera to the projection plane in world units.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetNearPlaneDistance

virtual GCoordinate GetNearPlaneDistance () const

Interface Category:

API.

Purpose:

Returns the distance of the front clipping plane from the camera.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a GCoordinate object that represents the distance of the front clipping plane from the camera in world units.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetFarPlaneDistance

virtual GCoordinate GetFarPlaneDistance () const

Interface Category:

API. Returns the distance of the far clipping plane from the camera.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a GCoordinate object that represents the distance of the far clipping plane from the camera in world units.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

API.

Other Considerations:

None.

Member Function: TParallelCamera::SetPosition

virtual void SetPosition (const TGPoint3D & cameraPosition)

Interface Category:

API.

Purpose:

Sets the camera position to the specified TGPoint3D.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetReferencePoint

virtual void SetReferencePoint (const TGPoint3D & viewReferencePoint)

Interface Category:

API.

Purpose:

Sets the point that the camera aims at.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetUpVector

virtual void SetUpVector (const TGPoint3D & upVector)

Interface Category:

API.

Purpose:

Sets the up vector, which defines the orientation of the camera. A value of (0., 1., 0.) is considered upright.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetTwistAngle

virtual void SetTwistAngle (GDegrees twistAngle)

Interface Category:

API.

Purpose:

Sets the twist angle, which defines the orientation of the camera, with respect to the y-axis.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetCropWindow

virtual void SetCropWindow (const TGRect & cropWindow)

Interface Category:

API.

Purpose:

Sets the area of interest within the viewfinder.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetProjectionPoint

virtual void SetProjectionPoint (const TGPoint & origin)

Interface Category:

API.

Purpose:

Sets the 2-D origin of the image.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetViewDistance

virtual void SetViewDistance (GCoordinate viewDistance)

Interface Category:

API.

Purpose:

Sets the distance from the camera to the projection plane.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetNearPlaneDistance

virtual void SetNearPlaneDistance (GCoordinate distance)

Interface Category:

API.

Purpose:

Sets the distance of the front clipping plane from the camera.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws a Parameter Assert exception if the distance specified is less than zero.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::SetFarPlaneDistance

virtual void SetFarPlaneDistance (GCoordinate distance)

Interface Category:

API.

Purpose:

Sets the distance of the far clipping plane from the camera.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws a Parameter Assert exception if the distance specified is less than zero.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::Zoom

virtual void Zoom (GCoordinate factor)

Interface Category:

API.

Purpose:

Scales the camera's distance from the projection plane by the specified scalar.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws a Parameter Assert exception if the zoom factor is less than zero.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::IsFrontSurface

  1. virtual bool IsFrontSurface (const TGPoint3D & surfacePoint0, const TGPoint3D & surfacePoint1, const TGPoint3D & surfacePoint2, const TGPoint3D & pointOnSurface) const
  2. virtual bool IsFrontSurface (const TGPoint3D & surfaceEquation, const TGPoint3D & pointOnSurface) const

Interface Category:

API.

Purpose:

  1. Returns true if the triangle specified by the three TGPoints and the point on the triangle's surface faces the camera.
  2. Returns true if the triangle specified by the surface equation and the point on the triangle's surface faces the camera.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

Returns true if the face of the specified triangle faces the camera.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The surfacePoints (0, 1, 2) of the triangle are specified in a counterclockwise direction.

Member Function: TParallelCamera::GetRay

virtual void GetRay (const TGPoint & screenPoint, TGPoint3D & origin, TGPoint3D & direction) const

Interface Category:

API.

Purpose:

Returns the vector from the eye point (camera) to the center of interest on the 2-D projection plane.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetViewMatrix

virtual const TGrafMatrix3D * GetViewMatrix () const

Interface Category:

API.

Purpose:

Returns the matrix that transforms from modeling coordinates into the coordinate system that has its origin at the eye point and its z-axis running from the eye point to the center of interest.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TGrafMatrix3D object that transforms the modeling coordinates into the viewer's coordinates.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::GetClipMatrix

virtual const TGrafMatrix3D * GetClipMatrix () const

Interface Category:

API.

Purpose:

Returns the matrix that transforms the pyramid defined by the clipping planes into a unit cube for the rendering pipeline.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a constant pointer to a TGrafMatrix3D object that transforms the clipping plane pyramid into a unit cube for the rendering pipeline.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::operator=

TParallelCamera & operator =(const TParallelCamera & src)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator. Only for internal use by Flatten. Developers should treat this function as protected.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator. This is only for internal use by Resurrect. Developers should treat this function as protected.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TParallelCamera::Project

  1. virtual void Project (const TGRPoint3D & point3D, TGPoint & point) const
  2. virtual void Project (const TGRPoint3D & point3D, TGRPoint & point) const

Interface Category:

API.

Purpose:

  1. Projects the given 3-D rational point onto the projection plane, returning the projected 2-D point in the TGPoint argument.
  2. Projects the given 3-D rational point onto the projection plane, returning the projected 2-D rational point in the TGRPoint argument.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.