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

12 Shape component

--- X3D separator bar ---

cube 12.1 Introduction

12.1.1 Name

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

12.1.2 Overview

This clause describes the Shape component of this part of ISO/IEC 19775. The Shape component defines nodes for associating geometry with their visible properties and the scene environment. Table 12.1 provides links to the major topics in this clause.

Table 12.1 — Topics in this clause

cube 12.2 Concepts

12.2.1 Shape nodes

The Shape node associates a geometry node with nodes that define that geometry's appearance. Shape nodes must be part of the transformation hierarchy to have any visible result, and the transformation hierarchy must contain Shape nodes for any geometry to be visible (the only nodes that render visible results are Shape nodes and the Background nodes described in 23, Environmental effects). A Shape node contains exactly one geometry node in its geometry field, which is of type X3DGeometryNode. The Shape node descends from the abstract base type X3DShapeNode.

The Shape2D node has the same behaviour as the Shape node but only allows 2D nodes to be specified as children.

12.2.2 Appearance node

Shape nodes may specify an Appearance node that describes the appearance properties (material, texture and texture transformation) to be applied to the Shape's geometry. All valid children of the Apperance node descend from the abstract base type X3DAppearanceChildNode.

Nodes of the following type may be specified in the material field of the Appearance node:

This set may be extended by creating new nodes derived from the X3DMaterialNode abstract base type.

The Appearance node specifies texture mapping in its texture field. Valid values of the texture field are descendants of X3DTextureNode, including:

This set may be extended by creating new nodes derived from the abstract X3DTextureNode base class as defined in 18.3.2, X3DTextureNode.

Nodes of the type X3DTextureTransformNode may be specified in the textureTransform field of the Appearance node (see 18.3.4, X3DTextureTransformNode), including:

The interaction between the appearance properties and properties specific to geometry nodes is described in 13, Geometry3D component and 14, Geometry2D component

An Appearance node ,may specify additional information about the appearance of the geometry. Special properties may be defined for lines and filled areas. These properties are defined in the lineProperties and fillProperties fields by the following nodes, respectively:

cube 12.3 Abstract types

12.3.1 X3DAppearanceChildNode

X3DAppearanceChildNode : X3DNode { 
}

This is the base node type for the child nodes of the X3DAppearanceNode type.

12.3.2 X3DAppearanceNode

X3DAppearanceNode : X3DNode {
}

This is the base node type for all Appearance nodes.

12.3.3 X3DMaterialNode

X3DMaterialNode : X3DAppearanceChildNode {
}

This is the base node type for all Material nodes.

12.3.4 X3DShapeNode

X3DShapeNode : X3DChildNode {
  SFNode [in,out] appearance NULL [X3DAppearanceNode]
  SFNode [in,out] geometry   NULL [X3DGeometryNode]
}

This is the base node type for all Shape nodes.

cube 12.4 Node reference

12.4.1 Appearance

Appearance : X3DAppearanceNode { 
  SFNode [in,out] fillProperties   NULL [FillProperties]
  SFNode [in,out] lineProperties   NULL [LineProperties]
  SFNode [in,out] material         NULL [X3DMaterialNode]
  SFNode [in,out] texture          NULL [X3DTextureNode]
  SFNode [in,out] textureTransform NULL [X3DTextureTransformNode]
}

The Appearance node specifies the visual properties of geometry. The value for each of the fields in this node may be NULL. However, if the field is non-NULL, it shall contain one node of the appropriate type.

The material field, if specified, shall contain a Material node. If the material field is NULLor unspecified, lighting is off (all lights are ignored during rendering of the object that references this Appearance) and the unlit object colour is (1, 1, 1). Details of the X3D lighting model are in 17, Lighting component.

The texture field, if specified, shall contain one of the various types of texture nodes:  ImageTexture, MovieTexture, or PixelTexture (see 18, Texturing component). If the texture node is NULL or the texture field is unspecified, the object that references this Appearance is not textured.

The textureTransform field, if specified, shall contain a TextureTransform node as defined in 18.4.8, TextureTransform. If the textureTransform is NULL or unspecified, the textureTransform field has no effect.

The lineProperties field, if specified, shall contain a LineProperties node as specified in 12.4.3 LineProperties. If lineProperties is NULL or unspecified, the lineProperties field has no effect.

The fillProperties field, if specified, shall contain a FillProperties node as specified in 12.4.2 FillProperties. If fillProperties is NULL or unspecified, the fillProperties field has no effect.

12.4.2 FillProperties

FillProperties : X3DAppearanceChildNode { 
  SFString [in,out] fillStyle  NONE  ["NONE","HATCHED"]
  SFColor  [in,out] hatchColor 1 1 1 [0,1]
  SFInt32  [in,out] hatchStyle 1     [0,∞)
}

The FillProperties node specifies additional properties to be applied to all polygonal areas on top of whatever appearance is specified by the other fields of the respective Appearance node. Thus, hatches are applied on top of the already rendered appearance of the node. Hatches are not affected by lighting.

The hatchStyle field selects a hatch pattern as defined in the ISO Registry of Graphical Items (see 2.[REG]). The hatches are rendered using the colour specified by the hatchColor field.

12.4.3 LineProperties

LineProperties : X3DAppearanceChildNode { 
  SFInt32 [in,out] lineStyle                0 [0,∞)
  SFFloat [in,out] linewidthScaleFactor     0 [0,∞}
}

The LineProperties node specifies additional properties to be applied to all line geometry. The colour of the line is specified by the associated Material node.

The lineStyle field selects a line pattern as defined in the ISO Registry of Graphical Items (see 2.[REG]).

The linewidthScaleFactor is a multiplicative value that scales a browser dependent nominal linewidth by the linewidth scale factor. This resulting value shall then be mapped to the nearest available line width. A value less than or equal to zero refers to the minimum available line width.

12.4.4 Material

Material : X3DMaterialNode { 
  SFFloat [in,out] ambientIntensity 0.2         [0,1]
  SFColor [in,out] diffuseColor     0.8 0.8 0.8 [0,1]
  SFColor [in,out] emissiveColor    0 0 0       [0,1]
  SFFloat [in,out] shininess        0.2         [0,1]
  SFColor [in,out] specularColor    0 0 0       [0,1]
  SFFloat [in,out] transparency     0           [0,1]
}

The Material node specifies surface material properties for associated geometry nodes and is used by the X3D lighting equations during rendering. 17, Lighting component contains a detailed description of the X3D lighting model equations.

All of the fields in the Material node range from 0.0 to 1.0.

The fields in the Material node determine how light reflects off an object to create colour:

  1. 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.
  2. The diffuseColor field reflects all X3D 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.
  3. 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.
  4. The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple). When the angle from the light to the surface is close to the angle from the surface to the viewer, the specularColor is added to the diffuse and ambient colour calculations. Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.
  5. The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.

12.4.5 Shape

Shape : X3DShapeNode, X3DBoundedObject {
  SFNode  [in,out] appearance NULL     [X3DAppearanceNode]
  SFNode  [in,out] geometry   NULL     [X3DGeometryNode]
  SFVec3f []       bboxCenter 0 0 0    (-∞,∞)
  SFVec3f []       bboxSize   -1 -1 -1 (0,∞) or -1 -1 -1
}

The Shape node has two fields, appearance and geometry, which are used to create rendered objects in the world. The appearance field contains an Appearance node that specifies the visual attributes (e.g., material and texture) to be applied to the geometry. The geometry field contains a geometry node. The specified geometry node is rendered with the specified appearance nodes applied. See 12.2, Concepts for more information.

17, Lighting component contains details of the X3D lighting model and the interaction between Appearance nodes and geometry nodes.

If the geometry field is NULL, the object is not drawn.

The bboxCenter and bboxSize fields specify a bounding box that encloses the Shape node's geometry. This is a hint that may be used for optimization purposes. The results are undefined if the specified bounding box is smaller than the actual bounding box of the geometry at any time. A default bboxSize value, (-1, -1, -1), implies that the bounding box is not specified and, if needed, is calculated by the browser. A description of the bboxCenter and bboxSize fields is contained in 10.2.2, Bounding boxes.

cube 12.5 Support levels

The Shape component provides three levels of support as specified in Table 12.2.

Table 12.2 — Shape component support levels

Level Prerequisites Nodes Support
1 Core 1;
Rendering 1;
Texturing 1
X3DAppearanceChildNode(abstract) n/a
X3DAppearanceNode (abstract) n/a
  X3DMaterialNode (abstract) n/a
X3DShapeNode (abstract) n/a
Appearance textureTransform optionally supported.
lineProperties optionally supported. fillProperties optionally supported.
Material ambientIntensity optionally supported. shininess optionally supported. specularColour optionally supported. A Material with emissiveColour not equal to (0,0,0), diffuseColor equal to (0,0,0) is an unlit material. One-bit transparency; transparency values ≥ 0.5 transparent.
Shape All fields
2 Core 1;
Rendering 1;
Texturing 1
All fields
All Level 1 Appearance nodes except Appearance All fields
    Appearance lineProperties optionally supported. fillProperties optionally supported.
3 Core 1;
Rendering 1;
Texturing 1
 
All Level 2 Appearance nodes All fields fully supported.
--- X3D separator bar ---