Cylinder

From Web3D.org
Revision as of 16:18, 1 February 2006 by Abergstrom (Talk | contribs)

Jump to: navigation, search

Cylinder

Cylinder : X3DGeometryNode { 
  SFNode  [in,out] metadata NULL [X3DMetadataObject]
  SFBool  []       bottom   TRUE
  SFFloat []       height   2    (0,∞)
  SFFloat []       radius   1    (0,∞)
  SFBool  []       side     TRUE
  SFBool  []       solid    TRUE
  SFBool  []       top      TRUE
}

The Cylinder node specifies a capped cylinder centred at (0,0,0) in the local coordinate system and with a central axis oriented along the local Y-axis. By default, the cylinder is sized at "-1" to "+1" in all three dimensions. The radius field specifies the radius of the cylinder and the height field specifies the height of the cylinder along the central axis. Both radius and height shall be greater than zero. Figure 1 illustrates the Cylinder node.


The cylinder has three parts: the side, the top (Y = +height/2) and the bottom (Y = �height/2). Each part has an associated SFBool field that indicates whether the part exists (TRUE) or does not exist (FALSE). Parts which do not exist are not rendered and not eligible for intersection tests (EXAMPLE collision detection or sensor activation).


Figure 1 - Cylinder

http://www.web3d.org/x3d/specifications/ISO-IEC-19775-X3DAbstractSpecification/Images/cylinder.gif

When a texture is applied to a cylinder, it is applied differently to the sides, top, and bottom. On the sides, the texture wraps counterclockwise (from above) starting at the back of the cylinder. The texture has a vertical seam at the back, intersecting the X=0 plane. For the top and bottom caps, a circle is cut out of the unit texture squares centred at (0, �height/2, 0) with dimensions 2 × radius by 2 × radius. The top texture appears right side up when the top of the cylinder is tilted toward the +Z-axis, and the bottom texture appears right side up when the top of the cylinder is tilted toward the �Z-axis. TextureTransform affects the texture coordinates of the Cylinder node.


The solid field determines whether the cylinder is visible when viewed from the inside. The Common geometry fields section of the X3D specification provides a complete description of the solid field.