The Annotated VRML 97 Reference

1 Intro     Concepts     3 Nodes     4 Fields/Events    Conformance
A Grammar     B Java     C JavaScript     D Examples     E Related Info    References
Quick Java         Quick JavaScript         Quick Nodes   
 

  About the Book
  
Help
  Copyright © 1997-99
  Purchase the book from Amazon.com

Chapter 3:
Node Reference


Intro
Anchor
Appearance
AudioClip
Background
Billboard
Box
Collision
Color
ColorInterpolator
Cone
Coordinate
CoordinateInterpolator
Cylinder
CylinderSensor
DirectionalLight
ElevationGrid
Extrusion
Fog
FontStyle
Group
ImageTexture
IndexedFaceSet
IndexedLineSet
Inline
LOD
Material
MovieTexture
NavigationInfo
Normal
NormalInterpolator
OrientationInterpolator
PixelTexture
PlaneSensor
PointLight
PointSet
PositionInterpolator
ProximitySensor
ScalarInterpolator
Script
Shape
Sound
Sphere
SphereSensor
SpotLight
Switch
Text
TextureCoordinate
TextureTransform
TimeSensor
TouchSensor
Transform
Viewpoint
VisibilitySensor
WorldInfo

+3.41 Shape

Shape {

  exposedField SFNode appearance NULL
  exposedField SFNode geometry   NULL
}

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.

"2.14 Lighting model" contains details of the VRML lighting model and the interaction between Appearance and geometry nodes.

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

EXAMPLE( click to run) : The following simple example illustrates the Shape node:

#VRML V2.0 utf8
Group { children [
  Transform {
    translation -3 0 0
    children Shape {
      geometry Box {}
      appearance Appearance {
        material Material { diffuseColor 1 0 0 }
      }
    }
  }
  Transform {
    children Shape {
      geometry Sphere {}
      appearance Appearance {
        material Material { diffuseColor 0 1 0 }
      }
    }
  }
  Transform {
    translation 3 0 0
    children Shape {
      geometry Cone {}
      appearance Appearance {
        material Material { diffuseColor 0 0 1 }
      }
    }
  }
]}