Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

VrmlFrustum Class Reference

A view frustum. More...

List of all members.


Public Methods

 VrmlFrustum ()
 Constructs a default frustum.

 VrmlFrustum (float afovy, float aaspect, double anear, double afar)
 Constructs and initializes a frustum.


Public Attributes

float fovy
 Vertical field of view.

float fovx
 Horizontal field of view.

double z_near
 Distance to the near clipping plane.

double z_far
 Distance to the far clipping plane.

float left_plane [4]
 Left (looking down -z) side clip plane.

float right_plane [4]
float top_plane [4]
float bot_plane [4]

Private Methods

void update ()
 Update the plane equations.


Detailed Description

A view frustum.

A frustum is more or less a truncated pyramid. This class represents frustums with their wide end facing down the -z axis, and their (theoretical) tip at the origin. A frustum is a convenient representation of the volume of virtual space visible through the on-screen window when using a perspective projection.

See also:
VrmlNode::render

Viewer


Constructor & Destructor Documentation

VrmlFrustum  
 

Constructs a default frustum.

fovy, fovx, near and far all get set to -1.

VrmlFrustum float    afovy,
float    aaspect,
double    anear,
double    afar
 

Constructs and initializes a frustum.

The field of view should be less than 180 degrees. Extreme aspect ratios are unlikely to work well. The near and far plane distances are always positive (think distance, not position). anear must be less than afar. This is supposed to look like gluPerspective.

Parameters:
afovy vertical field of view in degrees
aaspect ratio of view width to height (not the ratio of the horizontal to vertial field-of-views)
anear distance to near clip plane
afar distance to far clip plane

Member Function Documentation

void update   [private]
 

Update the plane equations.

The plane equations are derived from the other members.


Member Data Documentation

fovx
 

Horizontal field of view.

fovy
 

Vertical field of view.

left_plane
 

Left (looking down -z) side clip plane.

Format is (a,b,c,d) where (a,b,c) is the plane normal and d is the plane offset. For the momement the eyepoint is always the origin, so d is going to be 0.

z_far
 

Distance to the far clipping plane.

z_near
 

Distance to the near clipping plane.