Shapes 3D  3.0
 All Classes Functions Variables Pages
shapes3d.utils.Perspective Class Reference
Inheritance diagram for shapes3d.utils.Perspective:

Public Member Functions

 Perspective (float width, float height)
 
 Perspective (PGraphics pg)
 
void apply (PGraphics pg)
 
float fov ()
 
Perspective fov (float fov)
 
float fovLimit ()
 
float aspectRatio ()
 
Perspective aspectRatio (float aspectRatio)
 
float nearZ ()
 
Perspective nearZ (float nearZ)
 
float farZ ()
 
Perspective farZ (float farZ)
 
String toString ()
 

Detailed Description

This class holds the details for a perspective that can be applied to a PGraphics3D object.

Author
Peter Lager

Constructor & Destructor Documentation

shapes3d.utils.Perspective.Perspective ( float  width,
float  height 
)

Create a perspective suitable for a graphics object with the specified width and height in pixels

Parameters
widththe width in pixels
heightthe height in pixels
shapes3d.utils.Perspective.Perspective ( PGraphics  pg)

Create a perspective suitable for the specified graphics object.

Parameters
pgthe PGraphics3D object

Member Function Documentation

void shapes3d.utils.Perspective.apply ( PGraphics  pg)

Apply this perspective to the graphics context.

Parameters
pgthe PGraphics3D object
float shapes3d.utils.Perspective.aspectRatio ( )

Get the aspect ratio i.e. width/height

Returns
the aspectRatio
Perspective shapes3d.utils.Perspective.aspectRatio ( float  aspectRatio)

Set the aspect ratio for this perspective

Parameters
aspectRatiothe aspectRatio to set
Returns
this perspective
float shapes3d.utils.Perspective.farZ ( )

Get the far zone distance

Returns
the farZ
Perspective shapes3d.utils.Perspective.farZ ( float  farZ)

Set the far zone distance

Parameters
farZthe farZ to set
Returns
this perspective
float shapes3d.utils.Perspective.fov ( )

Get the field of view

Returns
the field of view
Perspective shapes3d.utils.Perspective.fov ( float  fov)

Set the field of view angle (radians)

Parameters
fovthe fov to set
Returns
this perspective
float shapes3d.utils.Perspective.fovLimit ( )

This can be used to determine whether a shape is within the field of view.

Returns
field of view limit value
float shapes3d.utils.Perspective.nearZ ( )

Get the near zone distance

Returns
the nearZ
Perspective shapes3d.utils.Perspective.nearZ ( float  nearZ)

Set the near zone distance

Parameters
nearZthe nearZ to set
Returns
this perspective

The documentation for this class was generated from the following file: