Extensible 3D (X3D)
Part 1: Architecture and base components

Shape Extensions (Custom)

--- X3D separator bar ---

cube Introduction

1.1 Name

The name of this component is "xj3d_Shape". This name shall be used when referring to this component in the COMPONENT statement (see Component statement).

1.2 Overview

This clause describes the xj3d_Shape component of this part of ISO/IEC 19775. This includes how to describe additional material properties for objects to allow separate colour values for the front and back sides of a polgon. Table 1 provides links to the major topics in this clause.

Table 1 — Topics

cube 2 Concepts

2.1 Overview

In many applications there is a need to be able to have geometry that always has both the front and back faces of the geometry showing. All the polygonal geometry defined in X3D contain a solid field describing whether the rendered output should be only showing the front face, or also include the back face. Knowing whether a front or back face is visible can sometimes be important to the application environment. CAD applications make great use of this, particularly when combined with clipping planes (See Clipping component) used to section an object. This component provides a way to render the front and back sides of the polygon with different material properties.

2.2 Material Semantics

A polygon defines a front face based on the direction of the normal. That normal is either explicitly provided by the end user or implicitly calculated by the browser based on the winding rules for the node (see the ccw field on many of the polygonal geometry nodes such as IndexedFaceSet).

Two-sided material demonstration

Figure 1 — Effects of two-sided materials on a clipped piece of geometry

When the back side of the material is rendered using the alternate colours, the rendering shall follow the normal lighting equations for lit geometry.

cube 3 Node reference

3.1 TwoSidedMaterial

Material : X3MaterialNode {
  SFFloat [in,out] ambientIntensity     0.2         [0,1]
  SFFloat [in,out] backAmbientIntensity 0.2         [0,1]
  SFColor [in,out] backDiffuseColor     0.8 0.8 0.8 [0,1]
  SFColor [in,out] backEmissiveColor    0 0 0       [0,1]
  SFFloat [in,out] backShininess        0.2         [0,1]
  SFColor [in,out] backSpecularColor    0 0 0       [0,1]
  SFFloat [in,out] backTransparency     0           [0,1]
  SFColor [in,out] diffuseColor         0.8 0.8 0.8 [0,1]
  SFColor [in,out] emissiveColor        0 0 0       [0,1]
  SFNode  [in,out] metadata             NULL        [X3DMetadataObject]
  SFFloat [in,out] shininess            0.2         [0,1]
  SFBool  [in,out] separateBackColor    FALSE
  SFColor [in,out] specularColor        0 0 0       [0,1]
  SFFloat [in,out] transparency         0           [0,1]

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,backTransparency as the appropriate components in the lighting equations (also assuming that the normal is flipped to indicate the reverse side of the polygon.

cube 5 Support Levels

The xj3d_Shape component defines a single level of support as specified in Table 2.

Table 2 — Clipping component support levels

Level Prerequisites Nodes/Features Support
1 Core 1
Grouping 1
Rendering 1
Shape 1
TwoSidedMaterial All fields fully supported.
--- X3D separator bar ---
[ Xj3D Homepage | Xj3D @ Web3d | Screenshots | Dev docs | Dev Releases | Contributors | Getting Started ]
Last updated: $Date: 2006-05-04 15:31:15 $