H3D::TwoSidedMaterial Class Reference
[X3D node classes.]

This node defines material properties that can effect both the front and back side of a polygon individually. More...

#include <H3D/TwoSidedMaterial.h>

Inheritance diagram for H3D::TwoSidedMaterial:

Inheritance graph

List of all members.

Public Member Functions

 TwoSidedMaterial (Inst< DisplayList > _displayList=0, Inst< SFFloat > _ambientIntensity=0, Inst< SFColor > _diffuseColor=0, Inst< SFColor > _emissiveColor=0, Inst< SFNode > _metadata=0, Inst< SFFloat > _shininess=0, Inst< SFColor > _specularColor=0, Inst< SFFloat > _transparency=0, Inst< SFFloat > _backAmbientIntensity=0, Inst< SFColor > _backDiffuseColor=0, Inst< SFColor > _backEmissiveColor=0, Inst< SFFloat > _backShininess=0, Inst< SFColor > _backSpecularColor=0, Inst< SFFloat > _backTransparency=0, Inst< SFBool > _separateBackColor=0)
 Constructor.
virtual void render ()
 Set up the material properties in OpenGL.
virtual void preRender ()
 This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.
virtual void postRender ()
 This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().
virtual bool isTransparent ()
 This function checks the transparency field to determine if the material requires that the geometry is rendered with transparency.

Public Attributes

auto_ptr< SFFloatambientIntensity
 The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect.
auto_ptr< SFColordiffuseColor
 The diffuseColor field reflects all light sources depending on the angle of the surface with respect to the light source.
auto_ptr< SFColoremissiveColor
 The emissiveColor field models "glowing" objects.
auto_ptr< SFFloatshininess
 Shininess effect the specular highlights.
auto_ptr< SFColorspecularColor
 The color of the specular highlights.
auto_ptr< SFFloattransparency
 The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.
auto_ptr< SFFloatbackAmbientIntensity
 The backAmbientIntensity is the same as the ambientIntensity field but will be used for the back side of the geometry if separateBackColor is true;.
auto_ptr< SFColorbackDiffuseColor
 The backDiffuseColor is the same as the diffuseColor field but will be used for the back side of the geometry if separateBackColor is true;.
auto_ptr< SFColorbackEmissiveColor
 The backEmissiveColor is the same as the emissiveColor field but will be used for the back side of the geometry if separateBackColor is true;.
auto_ptr< SFFloatbackShininess
 The backShininess is the same as the shininess field but will be used for the back side of the geometry if separateBackColor is true;.
auto_ptr< SFColorbackSpecularColor
 The backSpecularColor is the same as the specularColor field but will be used for the back side of the geometry if separateBackColor is true;.
auto_ptr< SFFloatbackTransparency
 The backTransparency is the same as the transparency field but will be used for the back side of the geometry if separateBackColor is true.
auto_ptr< SFBoolseparateBackColor
 If the separateBackColor field is set to TRUE, then the rendering shall render the front and back faces of the geometry with different values.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

This node defines material properties that can effect both the front and back side of a polygon individually.

These materials are used for both the front and back side of the geometry whenever the X3D lighting model is active.

If the separateBackColor field is set to TRUE, then the rendering shall render the front and back faces of the geometry with different values. If the value is FALSE, then the front colours are used for both the front and back side of the polygon, as per the existing X3D lighting rules.

When calculating the terms in the lighting equations, the front geometry shall use the fields ambientIntensity, diffuseColor,emissiveColor, shininess, specularColor, and transparency. The faces that are determined to be the back side are rendered using backAmbientIntensity, backDiffuseColor, backEmissiveColor, backShininess, and backTransparency as the appropriate components in the lighting equations.

Internal routes:
TwoSidedMaterial.dot

Member Function Documentation

virtual void H3D::TwoSidedMaterial::postRender (  )  [inline, virtual]

This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().

Reimplemented from H3D::X3DAppearanceChildNode.

virtual void H3D::TwoSidedMaterial::preRender (  )  [inline, virtual]

This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.

So this is the place to save the states that are going to be changed in render() in order to restore it in postRender().

Reimplemented from H3D::X3DAppearanceChildNode.


Member Data Documentation

The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect.

Ambient light is omnidirectional and depends only on the number of light sources, not their positions with respect to the surface. Ambient colour is calculated as ambientIntensity diffuseColor.

Access type: inputOutput
Default value: 0.2
Valid range: [0-1]

TwoSidedMaterial_ambientIntensity.dot

Referenced by render(), and TwoSidedMaterial().

The backAmbientIntensity is the same as the ambientIntensity field but will be used for the back side of the geometry if separateBackColor is true;.

Access type: inputOutput
Default value: 0.2
Valid range: [0-1]

TwoSidedMaterial_backAmbientIntensity.dot

Referenced by render(), and TwoSidedMaterial().

The backDiffuseColor is the same as the diffuseColor field but will be used for the back side of the geometry if separateBackColor is true;.

Access type: inputOutput
Default value: RGB( 0.8, 0.8, 0.8 )
Valid range: [0-1]

TwoSidedMaterial_backDiffuseColor.dot

Referenced by render(), and TwoSidedMaterial().

The backEmissiveColor is the same as the emissiveColor field but will be used for the back side of the geometry if separateBackColor is true;.

Access type: inputOutput
Default value: RGB( 0, 0, 0 )
Valid range: [0-1]

TwoSidedMaterial_backEmissiveColor.dot

Referenced by render(), and TwoSidedMaterial().

The backShininess is the same as the shininess field but will be used for the back side of the geometry if separateBackColor is true;.

Access type: inputOutput
Default value: 0.2
Valid range: [0-1]

TwoSidedMaterial_backShininess.dot

Referenced by render(), and TwoSidedMaterial().

The backSpecularColor is the same as the specularColor field but will be used for the back side of the geometry if separateBackColor is true;.

Access type: inputOutput
Default value: RGB( 0, 0, 0 )
Valid range: [0-1]

TwoSidedMaterial_backSpecularColor.dot

Referenced by render(), and TwoSidedMaterial().

The backTransparency is the same as the transparency field but will be used for the back side of the geometry if separateBackColor is true.

Access type: inputOutput
Default value: 0
Valid range: [0-1]

TwoSidedMaterial_backTransparency.dot

Referenced by TwoSidedMaterial().

The diffuseColor field reflects all light sources depending on the angle of the surface with respect to the light source.

The more directly the surface faces the light, the more diffuse light reflects.

Access type: inputOutput
Default value: RGB( 0.8, 0.8, 0.8 )
Valid range: [0-1]

TwoSidedMaterial_diffuseColor.dot

Referenced by render(), and TwoSidedMaterial().

The emissiveColor field models "glowing" objects.

This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data.

Access type: inputOutput
Default value: RGB( 0, 0, 0 )
Valid range: [0-1]

TwoSidedMaterial_emissiveColor.dot

Referenced by render(), and TwoSidedMaterial().

If the separateBackColor field is set to TRUE, then the rendering shall render the front and back faces of the geometry with different values.

If the value is FALSE, then the front colours are used for both the front and back side of the polygon,

Access type: inputOutput
Default value: 0
Valid range: [0-1]

TwoSidedMaterial_separateBackColor.dot

Referenced by render(), and TwoSidedMaterial().

Shininess effect the specular highlights.

Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.

Access type: inputOutput
Default value: 0.2
Valid range: [0-1]

TwoSidedMaterial_shininess.dot

Referenced by render(), and TwoSidedMaterial().

The color of the specular highlights.

Access type: inputOutput
Default value: RGB( 0, 0, 0 )
Valid range: [0-1]

TwoSidedMaterial_specularColor.dot

Referenced by render(), and TwoSidedMaterial().

The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.

Access type: inputOutput
Default value: 0
Valid range: [0-1]

TwoSidedMaterial_transparency.dot

Referenced by render(), and TwoSidedMaterial().


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

Generated on Fri Nov 7 10:31:21 2008 for H3D API by  doxygen 1.5.7