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.36 PointSet

PointSet { 
  exposedField  SFNode  color      NULL
  exposedField  SFNode  coord      NULL
}

The PointSet node specifies a set of 3D points, in the local coordinate system, with associated colours at each point. The coord field specifies a Coordinate node (or instance of a Coordinate node). Results are undefined if the coord field specifies any other type of node. PointSet uses the coordinates in order. If the coord field is NULL, the point set is considered empty.

PointSet nodes are not lit, not texture-mapped, nor do they participate in collision detection. The size of each point is implementation-dependent.

If the color field is not NULL, it shall specify a Color node that contains at least the number of points contained in the coord node. Results are undefined if the color field specifies any other type of node. Colours shall be applied to each point in order. The results are undefined if the number of values in the Color node is less than the number of values specified in the Coordinate node.

If the color field is NULL and there is a Material node defined for the Appearance node affecting this PointSet node, the emissiveColor of the Material node shall be used to draw the points. More details on lighting equations can be found in "2.14 Lighting model."

TECHNICAL NOTE: Implementations decide how large or small the points should appear. There is no way of setting the size of the points. If there were a way of specifying how large points should be, it isn't clear what units should be used. Most rendering systems that support points allow specification of size in pixels, but the size of one pixel can vary dramatically depending on the resolution of the display device. A common problem with resolution-dependent standards is that technology keeps on making content created for a specific resolution obsolete. Applications designed for the 640 x 480-pixel screens of yesterday look postage stamp sized on today's 1000 x 1000+ screens.

Open Inventor follows the PostScript model, specifying point sizes (and line widths, another feature not in VRML 2.0) in points--1/72 of an inch--with the special size of zero interpreted to mean "as small as the display device allows." Doing something similar for VRML would be possible, perhaps using millimeters or another metric measurement to match VRML's default unit of meters. However, using any "real-world" measurement poses serious problems for immersive display systems where the user cannot hold a tape measure up to the computer screen to measure how big a PointSet point is because they are inside the display. One millimeter is a lot of pixels on a head-mounted display that is only a few centimeters away from your eye.

Specifying point sizes just like any other size in VRML (in the local coordinate system of the PointSet node) causes implementation problems, since conventional displays must then make points larger and smaller as they get closer and farther from the viewer. Typically, content creators don't want their PointSets to change size, either.

This issue will undoubtedly come up again, since varying line widths and point sizes is an often-requested feature and necessary for several important applications. Perhaps a measurement such as the angle subtended by a point might be used, allowing precise and efficient implementations on both immersive and nonimmersive displays.


EXAMPLE (click to run): The following example illustrates a simple case of the PointSet node. The first Shape defines a PointSet consisting of seven randomly located points with a color specified for each one. The second PointSet uses the same seven coordinates, but specifies the point color by using a Material node's emissiveColor field. Note that the all other fields of the Material are ignored. A TimeSensor routed to an OrientationInterpolator spins the root Transform:

#VRML V2.0 utf8
DEF T Transform { children [
  Shape {
    geometry PointSet {
      coord DEF C Coordinate {
        point [ 0 -1 2, 1 0 0, -2 3 -1, -4 0 0,
                -2 2 -1, 5 -2 1, 3 -6 3  ]
      }
      color Color {
        color [ 1 0 0, 0 1 0, 1 1 0, 0 1 1,
                1 1 1, 1 0 0, 1 0 0 ]
      }
    }
  }
  Transform {
    rotation 1 0 0 1.57
    children Shape {
      geometry PointSet { coord USE C }
      appearance Appearance {
        material Material {
          emissiveColor 0 1 0  # defines the point colors
          diffuseColor 1 0 0   # has no effect at all
        }
      }
    }
  }
  DEF TS TimeSensor {
    stopTime -1
    loop TRUE
    cycleInterval 1.0
  }
  DEF OI OrientationInterpolator {
    key [ 0 .5 1 ]
    keyValue [ 0 1 0 0, 0 1 0 3.14, 0 1 0 6.27 ]
  }
]}
ROUTE TS.fraction_changed TO OI.set_fraction
ROUTE OI.value_changed TO T.rotation