Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoPolygonOffset Class Reference

The SoPolygonOffset class is a node type for "layering" rendering primitives. More...

#include <Inventor/nodes/SoPolygonOffset.h>

Inheritance diagram for SoPolygonOffset::

SoNode SoFieldContainer SoBase List of all members.

Public Types

enum  Style { FILLED = SoPolygonOffsetElement::FILLED, LINES = SoPolygonOffsetElement::LINES, POINTS = SoPolygonOffsetElement::POINTS }

Public Methods

 SoPolygonOffset (void)
virtual void doAction (SoAction *action)
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)

Static Public Methods

void initClass (void)

Public Attributes

SoSFFloat factor
SoSFFloat units
SoSFBitMask styles
SoSFBool on

Protected Methods

virtual ~SoPolygonOffset ()

Detailed Description

The SoPolygonOffset class is a node type for "layering" rendering primitives.

A common problem with realtime 3D rendering systems is that rendered primitives which are at approximately the same depth with regard to the camera viewpoint will appear to flicker. I.e.: from one angle one primitive will appear to be closer, while at another angle, another primitive will appear closer. When this happens, the rendered graphics at that part of the scene will of course look a lot less visually pleasing.

One common situation where this problem often occurs is when you attempt to put a wireframe grid as an outline on top of filled polygons.

The cause of the problem described above is that the Z-buffer of any render system has a limited resolution, often at 16, 24 or 32 bits. Because of this, primitives which are close will sometimes get the same depth value in the Z-buffer, even though they are not actually at the same depth-coordinate.

To rectify the flickering problem, this node can be inserted in the scene graph at the proper place(s) to explicitly define how polygons, lines and/or points should be offset with regard to other primitives.

This node class is an extension versus the original SGI Inventor v2.1 API. In addition to being a Coin extension, it is also present in TGS' Inventor implementation (with the same API).


Member Enumeration Documentation

enum SoPolygonOffset::Style
 

Enumeration of the rendering primitives which can be influenced by an SoPolygonOffset node.


Constructor & Destructor Documentation

SoPolygonOffset::SoPolygonOffset void
 

Constructor.

SoPolygonOffset::~SoPolygonOffset [protected, virtual]
 

Destructor.


Member Function Documentation

void SoPolygonOffset::initClass void [static]
 

Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

Reimplemented from SoNode.

void SoPolygonOffset::doAction SoAction * action [virtual]
 

This function performs the typical operation of a node for any action.

Reimplemented from SoNode.

void SoPolygonOffset::callback SoCallbackAction * action [virtual]
 

Action method for SoCallbackAction.

Simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph.

Reimplemented from SoNode.

void SoPolygonOffset::GLRender SoGLRenderAction * action [virtual]
 

Action method for the SoGLRenderAction.

This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method.

Reimplemented from SoNode.


Member Data Documentation

SoSFFloat SoPolygonOffset::factor
 

Offset multiplication factor.

SoSFFloat SoPolygonOffset::units
 

Absolute offset translation value.

SoSFBitMask SoPolygonOffset::styles
 

The rendering primitive type to be influenced by this node. Defaults to SoPolygonOffset::FILLED.

SoSFBool SoPolygonOffset::on
 

Whether the offset is on or off. Default is for SoPolygonOffset::on to be TRUE.


The documentation for this class was generated from the following files:
Generated at Tue Mar 5 03:31:29 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001