home *** CD-ROM | disk | FTP | other *** search
/ PC Press: Internet / PC_PRESS.ISO / software / www / vrml / spec10.txt < prev    next >
Encoding:
Text File  |  1996-03-20  |  60.9 KB  |  1,585 lines

  1. [VRML]
  2.  
  3. The Virtual Reality Modeling Language
  4.  
  5.    Version 1.0 Specification
  6.  
  7. 26-MAY-95
  8.  
  9.      Gavin Bell, Silicon Graphics, Inc.
  10.      Anthony Parisi, Intervista Software
  11.      Mark Pesce, VRML List Moderator
  12.  
  13. ----------------------------------------------------------------------------
  14.  
  15. Acknowledgements
  16.  
  17.      I want to thank three people who have been absolutely instrumental
  18.      in the design process: Brian Behlendorf, whose drive (and disk
  19.      space) made this process happen; and Tony Parisi and Gavin Bell,
  20.      the final authors of this specification, who have put in a great
  21.      deal of design work, ensuring that we have a satisfactory product.
  22.      My hat goes off to all of them, and to all of you who have made
  23.      this process a success.
  24.  
  25. Mark Pesce
  26.  
  27.      I would like to add a personal note of thanks to Jan Hardenbergh
  28.      of Oki Advanced Products for his diligent efforts to keep the
  29.      specification process on track, and his invaluable editing
  30.      assistance. I would also like to acknowledge Chris Marrin of
  31.      Silicon Graphics for his timely contributions to the final design.
  32.  
  33. Tony Parisi
  34.  
  35. Revision History
  36.  
  37.    * First Draft - November 2, 1994
  38.    * Second Draft - May 8, 1995
  39.    * Third Draft - May 26, 1995
  40.  
  41. Table of Contents
  42.  
  43.    *  Introduction
  44.  
  45.         o  VRML Mission Statement
  46.         o  History
  47.         o  Version 1.0 Requirements
  48.  
  49.    *  Language Specification
  50.  
  51.         o  Language Basics
  52.         o  Coordinate System
  53.         o  Fields
  54.         o  Nodes
  55.         o  Instancing
  56.         o  Extensibility
  57.         o  An Example
  58.  
  59.    *  Browser Considerations
  60.  
  61.         o  File Extensions
  62.         o  MIME Types
  63.  
  64. ----------------------------------------------------------------------------
  65.  
  66.    Introduction
  67.  
  68. The Virtual Reality Modeling Language (VRML) is a language for describing
  69. multi-participant interactive simulations -- virtual worlds networked via
  70. the global Internet and hyperlinked with the World Wide Web. All aspects of
  71. virtual world display, interaction and internetworking can be specified
  72. using VRML. It is the intention of its designers that VRML become the
  73. standard language for interactive simulation within the World Wide Web.
  74.  
  75. The first version of VRML allows for the creation of virtual worlds with
  76. limited interactive behavior. These worlds can contain objects which have
  77. hyperlinks to other worlds, HTML documents or other valid MIME types. When
  78. the user selects an object with a hyperlink, the appropriate MIME viewer is
  79. launched. When the user selects a link to a VRML document from within a
  80. correctly configured WWW browser, a VRML viewer is launched. Thus VRML
  81. viewers are the perfect companion applications to standard WWW browsers for
  82. navigating and visualizing the Web. Future versions of VRML will allow for
  83. richer behaviors, including animations, motion physics and real-time
  84. multi-user interaction.
  85.  
  86. This document specifies the features and syntax of Version 1.0 of VRML.
  87.  
  88.    VRML Mission Statement
  89.  
  90. The history of the development of the Internet has had three distinct
  91. phases; first, the development of the TCP/IP infrastructure which allowed
  92. documents and data to be stored in a proximally independent way; that is,
  93. Internet provided a layer of abstraction between data sets and the hosts
  94. which manipulated them. While this abstraction was useful, it was also
  95. confusing; without any clear sense of "what went where", access to Internet
  96. was restricted to the class of sysops/net surfers who could maintain
  97. internal cognitive maps of the data space.
  98.  
  99. Next, Tim Berners-Lee's work at CERN, where he developed the hypermedia
  100. system known as World Wide Web, added another layer of abstraction to the
  101. existing structure. This abstraction provided an "addressing" scheme, a
  102. unique identifier (the Universal Resource Locator), which could tell anyone
  103. "where to go and how to get there" for any piece of data within the Web.
  104. While useful, it lacked dimensionality; there's no there there within the
  105. web, and the only type of navigation permissible (other than surfing) is by
  106. direct reference. In other words, I can only tell you how to get to the VRML
  107. Forum home page by saying, "http://www.wired.com/", which is not
  108. human-centered data. In fact, I need to make an effort to remember it at
  109. all. So, while the World Wide Web provides a retrieval mechanism to
  110. complement the existing storage mechanism, it leaves a lot to be desired,
  111. particularly for human beings.
  112.  
  113. Finally, we move to "perceptualized" Internetworks, where the data has been
  114. sensualized, that is, rendered sensually. If something is represented
  115. sensually, it is possible to make sense of it. VRML is an attempt (how
  116. successful, only time and effort will tell) to place humans at the center of
  117. the Internet, ordering its universe to our whims. In order to do that, the
  118. most important single element is a standard that defines the particularities
  119. of perception. Virtual Reality Modeling Language is that standard, designed
  120. to be a universal description language for multi-participant simulations.
  121.  
  122. These three phases, storage, retrieval, and perceptualization are analogous
  123. to the human process of consciousness, as expressed in terms of semantics
  124. and cognitive science. Events occur and are recorded (memory); inferences
  125. are drawn from memory (associations), and from sets of related events, maps
  126. of the universe are created (cognitive perception). What is important to
  127. remember is that the map is not the territory, and we should avoid becoming
  128. trapped in any single representation or world-view. Although we need to
  129. design to avoid disorientation, we should always push the envelope in the
  130. kinds of experience we can bring into manifestation!
  131.  
  132. This document is the living proof of the success of a process that was
  133. committed to being open and flexible, responsive to the needs of a growing
  134. Web community. Rather than re-invent the wheel, we have adapted an existing
  135. specification (Open Inventor) as the basis from which our own work can grow,
  136. saving years of design work and perhaps many mistakes. Now our real work can
  137. begin; that of rendering our noospheric space.
  138.  
  139.    History
  140.  
  141. VRML was conceived in the spring of 1994 at the first annual World Wide Web
  142. Conference in Geneva, Switzerland. Tim Berners-Lee and Dave Raggett
  143. organized a Birds-of-a-Feather (BOF) session to discuss Virtual Reality
  144. interfaces to the World Wide Web. Several BOF attendees described projects
  145. already underway to build three dimensional graphical visualization tools
  146. which interoperate with the Web. Attendees agreed on the need for these
  147. tools to have a common language for specifying 3D scene description and WWW
  148. hyperlinks -- an analog of HTML for virtual reality. The term Virtual
  149. Reality Markup Language (VRML) was coined, and the group resolved to begin
  150. specification work after the conference. The word 'Markup' was later changed
  151. to 'Modeling' to reflect the graphical nature of VRML.
  152.  
  153. Shortly after the Geneva BOF session, the www-vrml mailing list was created
  154. to discuss the development of a specification for the first version of VRML.
  155. The response to the list invitation was overwhelming: within a week, there
  156. were over a thousand members. After an initial settling-in period, list
  157. moderator Mark Pesce of Labyrinth Group announced his intention to have a
  158. draft version of the specification ready by the WWW Fall 1994 conference, a
  159. mere five months away. There was general agreement on the list that, while
  160. this schedule was aggressive, it was achievable provided that the
  161. requirements for the first version were not too ambitious and that VRML
  162. could be adapted from an existing solution. The list quickly agreed upon a
  163. set of requirements for the first version, and began a search for
  164. technologies which could be adapted to fit the needs of VRML.
  165.  
  166. The search for existing technologies turned up a several worthwhile
  167. candidates. After much deliberation the list came to a consensus: the Open
  168. Inventor ASCII File Format from Silicon Graphics, Inc. The Inventor File
  169. Format supports complete descriptions of 3D scenes with polygonally rendered
  170. objects, lighting, materials, ambient properties and realism effects. A
  171. subset of the Inventor File Format, with extensions to support networking,
  172. forms the basis of VRML. Gavin Bell of Silicon Graphics has adapted the
  173. Inventor File Format for VRML, with design input from the mailing list. SGI
  174. has publicly stated that the file format is available for use in the open
  175. market, and have contributed a file format parser into the public domain to
  176. bootstrap VRML viewer development.
  177.  
  178.    Version 1.0 Requirements
  179.  
  180. VRML 1.0 is designed to meet the following requirements:
  181.  
  182.    *  Platform independence
  183.    *  Extensibility
  184.    *  Ability to work well over low-bandwidth connections
  185.  
  186. As with HTML, the above are absolute requirements for a network language
  187. standard; they should need little explanation here.
  188.  
  189. Early on the designers decided that VRML would not be an extension to HTML.
  190. HTML is designed for text, not graphics. Also, VRML requires even more
  191. finely tuned network optimizations than HTML; it is expected that a typical
  192. VRML scene will be composed of many more "inline" objects and served up by
  193. many more servers than a typical HTML document. Moreover, HTML is an
  194. accepted standard, with existing implementations that depend on it. To
  195. impede the HTML design process with VRML issues and constrain the VRML
  196. design process with HTML compatibility concerns would be to do both
  197. languages a disservice. As a network language, VRML will succeed or fail
  198. independent of HTML.
  199.  
  200. It was also decided that, except for the hyperlinking feature, the first
  201. version of VRML would not support interactive behaviors. This was a
  202. practical decision intended to streamline design and implementation. Design
  203. of a language for describing interactive behaviors is a big job, especially
  204. when the language needs to express behaviors of objects communicating on a
  205. network. Such languages do exist; if we had chosen one of them, we would
  206. have risked getting into a "language war." People don't get excited about
  207. the syntax of a language for describing polygonal objects; people get very
  208. excited about the syntax of real languages for writing programs. Religious
  209. wars can extend the design process by months or years. In addition,
  210. networked inter-object operation requires brokering services such as those
  211. provided by CORBA or OLE, services which don't exist yet within WWW; we
  212. would have had to invent them. Finally, by keeping behaviors out of Version
  213. 1, we have made it a much smaller task to implement a viewer. We acknowledge
  214. that support for arbitrary interactive behaviors is critical to the
  215. long-term success of VRML; they will be included in Version 2.
  216.  
  217. ----------------------------------------------------------------------------
  218.  
  219.    Language Specification
  220.  
  221. The language specification is divided into the following sections:
  222.  
  223.    *  Language Basics
  224.    *  Coordinate System
  225.    *  Fields
  226.    *  Nodes
  227.    *  Instancing
  228.    *  Extensibility
  229.    *  An Example
  230.  
  231.    Language Basics
  232.  
  233. At the highest level of abstraction, VRML is just a way for objects to read
  234. and write themselves. Theoretically, the objects can contain anything -- 3D
  235. geometry, MIDI data, JPEG images, anything. VRML defines a set of objects
  236. useful for doing 3D graphics. These objects are called Nodes.
  237.  
  238. Nodes are arranged in hierarchical structures called scene graphs. Scene
  239. graphs are more than just a collection of nodes; the scene graph defines an
  240. ordering for the nodes. The scene graph has a notion of state -- nodes
  241. earlier in the scene can affect nodes that appear later in the scene. For
  242. example, a Rotation or Material node will affect the nodes after it in the
  243. scene. A mechanism is defined to limit the effects of properties (separator
  244. nodes), allowing parts of the scene graph to be functionally isolated from
  245. other parts.
  246.  
  247. A node has the following characteristics:
  248.  
  249.    *  What kind of object it is. A node might be a cube, a sphere, a texture
  250.      map, a transformation, etc.
  251.  
  252.    *  The parameters that distinguish this node from other nodes of the same
  253.      type. For example, each Sphere node might have a different radius, and
  254.      different texture maps nodes will certainly contain different images to
  255.      use as the texture maps. These parameters are called Fields. A node can
  256.      have 0 or more fields.
  257.  
  258.    *  A name to identify this node. Being able to name nodes and refer to
  259.      them elsewhere is very powerful; it allows a scene's author to give
  260.      hints to applications using the scene about what is in the scene, and
  261.      creates possibilities for very powerful scripting extensions. Nodes do
  262.      not have to be named, but if they are named, they can have only one
  263.      name. However, names do not have to be unique-- several different nodes
  264.      may be given the same name.
  265.  
  266.    *  Child nodes. Object hierarchy is implemented by allowing some types of
  267.      nodes to contain other nodes. Parent nodes traverse their children in
  268.      order during rendering. Nodes that may have children are referred to as
  269.      group nodes. Group nodes can have zero or more children.
  270.  
  271. The syntax chosen to represent these pieces of information is
  272. straightforward:
  273.  
  274. DEF objectname objecttype { fields  children }
  275.  
  276. Only the object type and curly braces are required; nodes may or may not
  277. have a name, fields, and children.
  278.  
  279. Node names must not begin with a digit, and must not contain spaces or
  280. control characters, single or double quote characters, backslashes, curly
  281. braces, the plus character or the period character.
  282.  
  283. For example, this file contains a simple scene defining a view of a red cone
  284. and a blue sphere, lit by a directional light:
  285.  
  286. #VRML V1.0 ascii
  287. Separator {
  288.     DirectionalLight {
  289.         direction 0 0 -1  # Light shining from viewer into scene
  290.     }
  291.     PerspectiveCamera {
  292.         position    -8.6 2.1 5.6
  293.         orientation -0.1352 -0.9831 -0.1233  1.1417
  294.         focalDistance       10.84
  295.     }
  296.     Separator {   # The red sphere
  297.         Material {
  298.             diffuseColor 1 0 0   # Red
  299.         }
  300.         Translation { translation 3 0 1 }
  301.         Sphere { radius 2.3 }
  302.     }
  303.     Separator {  # The blue cube
  304.         Material {
  305.             diffuseColor 0 0 1  # Blue
  306.         }
  307.         Transform {
  308.             translation -2.4 .2 1
  309.             rotation 0 1 1  .9
  310.         }
  311.         Cube {}
  312.     }
  313.  
  314.  
  315. General Syntax
  316.  
  317. For easy identification of VRML files, every VRML file must begin with the
  318. characters:
  319.  
  320. #VRML V1.0 ascii
  321.  
  322. Any characters after these on the same line are ignored. The line is
  323. terminated by either the ASCII newline or carriage-return characters.
  324.  
  325. The '#' character begins a comment; all characters until the next newline or
  326. carriage return are ignored. The only exception to this is within string
  327. fields, where the '#' character will be part of the string.
  328.  
  329. Note: Comments and whitespace may not be preserved; in particular, a VRML
  330. document server may strip comments and extraneous whitespace from a VRML
  331. file before transmitting it. Info nodes should be used for persistent
  332. information like copyrights or author information. Info nodes could also be
  333. used for object descriptions.
  334.  
  335. Blanks, tabs, newlines and carriage returns are whitespace characters
  336. wherever they appear outside of string fields. One or more whitespace
  337. characters separates the syntactical entities in VRML files, where
  338. necessary.
  339.  
  340. After the required header, a VRML file contains exactly one VRML node. That
  341. node may of course be a group node, containing any number of other nodes.
  342.  
  343.    Coordinate System
  344.  
  345. VRML uses a cartesian, right-handed, 3-dimensional coordinate system. By
  346. default, objects are projected onto a 2-dimensional device by projecting
  347. them in the direction of the positive Z axis, with the positive X axis to
  348. the right and the positive Y axis up. A camera or modeling transformation
  349. may be used to alter this default projection.
  350.  
  351. The standard unit for lengths and distances specified is meters. The
  352. standard unit for angles is radians.
  353.  
  354.    Fields
  355.  
  356. There are two general classes of fields; fields that contain a single value
  357. (where a value may be a single number, a vector, or even an image), and
  358. fields that contain multiple values. Single-valued fields all have names
  359. that begin with "SF", multiple-valued fields have names that begin with
  360. "MF". Each field type defines the format for the values it writes.
  361.  
  362. Multiple-valued fields are written as a series of values separated by
  363. commas, all enclosed in square brackets. If the field has zero values then
  364. only the square brackets ("[]") are written. The last may optionally be
  365. followed by a comma. If the field has exactly one value, the brackets may be
  366. omitted and just the value written. For example, all of the following are
  367. valid for a multiple-valued field containing the single integer value 1:
  368.  
  369.  
  370. [1,]
  371. [ 1 ]
  372.  
  373. SFBitMask
  374.  
  375. A single-value field that contains a mask of bit flags. Nodes that use this
  376. field class define mnemonic names for the bit flags. SFBitMasks are written
  377. to file as one or more mnemonic enumerated type names, in this format:
  378.  
  379. ( flag1 | flag2 | ... )
  380.  
  381. If only one flag is used in a mask, the parentheses are optional. These
  382. names differ among uses of this field in various node classes.
  383.  
  384. SFBool
  385.  
  386. A field containing a single boolean (true or false) value. SFBools may be
  387. written as 0 (representing FALSE), 1, TRUE, or FALSE.
  388.  
  389. SFColor
  390.  
  391. A single-value field containing a color. SFColors are written to file as an
  392. RGB triple of floating point numbers in standard scientific notation, in the
  393. range 0.0 to 1.0.
  394.  
  395. SFEnum
  396.  
  397. A single-value field that contains an enumerated type value. Nodes that use
  398. this field class define mnemonic names for the values. SFEnums are written
  399. to file as a mnemonic enumerated type name. The name differs among uses of
  400. this field in various node classes.
  401.  
  402. SFFloat
  403.  
  404. A field that contains one single-precision floating point number. SFFloats
  405. are written to file in standard scientific notation.
  406.  
  407. SFImage
  408.  
  409. A field that contain an uncompressed 2-dimensional color or greyscale image.
  410.  
  411. SFImages are written to file as three integers representing the width,
  412. height and number of components in the image, followed by width*height
  413. hexadecimal values representing the pixels in the image, separated by
  414. whitespace. A one-component image will have one-byte hexadecimal values
  415. representing the intensity of the image. For example, 0xFF is full
  416. intensity, 0x00 is no intensity. A two-component image puts the intensity in
  417. the first (high) byte and the transparency in the second (low) byte. Pixels
  418. in a three-component image have the red component in the first (high) byte,
  419. followed by the green and blue components (so 0xFF0000 is red).
  420. Four-component images put the transparency byte after red/green/blue (so
  421. 0x0000FF80 is semi-transparent blue). A value of 1.0 is completely
  422. transparent, 0.0 is completely opaque. Note: each pixel is actually read as
  423. a single unsigned number, so a 3-component pixel with value "0x0000FF" can
  424. also be written as "0xFF" or "255" (decimal). Pixels are specified from left
  425. to right, bottom to top. The first hexadecimal value is the lower left pixel
  426. of the image, and the last value is the upper right pixel.
  427.  
  428. For example,
  429.  
  430. 1 2 1 0xFF 0x00
  431.  
  432. is a 1 pixel wide by 2 pixel high greyscale image, with the bottom pixel
  433. white and the top pixel black. And:
  434.  
  435. 2 4 3 0xFF0000 0xFF00 0 0 0 0 0xFFFFFF 0xFFFF00
  436.  
  437. is a 2 pixel wide by 4 pixel high RGB image, with the bottom left pixel red,
  438. the bottom right pixel green, the two middle rows of pixels black, the top
  439. left pixel white, and the top right pixel yellow.
  440.  
  441. SFLong
  442.  
  443. A field containing a single long (32-bit) integer. SFLongs are written to
  444. file as an integer in decimal, hexadecimal (beginning with '0x') or octal
  445. (beginning with '0') format.
  446.  
  447. SFMatrix
  448.  
  449. A field containing a transformation matrix. SFMatrices are written to file
  450. in row-major order as 16 floating point numbers separated by whitespace. For
  451. example, a matrix expressing a translation of 7.3 units along the X axis is
  452. written as:
  453.  
  454. 1 0 0 0  0 1 0 0  0 0 1 0  7.3 0 0 1
  455.  
  456. SFRotation
  457.  
  458. A field containing an arbitrary rotation. SFRotations are written to file as
  459. four floating point values separated by whitespace. The 4 values represent
  460. an axis of rotation followed by the amount of right-handed rotation about
  461. that axis, in radians. For example, a 180 degree rotation about the Y axis
  462. is:
  463.  
  464. 0 1 0  3.14159265
  465.  
  466. SFString
  467.  
  468. A field containing an ASCII string (sequence of characters). SFStrings are
  469. written to file as a sequence of ASCII characters in double quotes (optional
  470. if the string doesn't contain any whitespace). Any characters (including
  471. newlines) may appear within the quotes. To include a double quote character
  472. within the string, precede it with a backslash. For example:
  473.  
  474. Testing
  475. "One, Two, Three"
  476. "He said, \"Immel did it!\""
  477.  
  478. are all valid strings.
  479.  
  480. SFVec2f
  481.  
  482. Field containing a two-dimensional vector. SFVec2fs are written to file as a
  483. pair of floating point values separated by whitespace.
  484.  
  485. SFVec3f
  486.  
  487. Field containing a three-dimensional vector. SFVec3fs are written to file as
  488. three floating point values separated by whitespace.
  489.  
  490. MFColor
  491.  
  492. A multiple-value field that contains any number of RGB colors. MFColors are
  493. written to file as one or more RGB triples of floating point numbers in
  494. standard scientific notation. When more than one value is present, all of
  495. the values must be enclosed in square brackets and separated by commas. For
  496. example:
  497.  
  498. [ 1.0 0.0 0.0, 0 1 0, 0 0 1 ]
  499.  
  500. represents the three colors red, green, and blue.
  501.  
  502. MFLong
  503.  
  504. A multiple-value field that contains any number of long (32-bit) integers.
  505. MFLongs are written to file as one or more integer values, in decimal,
  506. hexadecimal or octal format. When more than one value is present, all the
  507. values are enclosed in square brackets and separated by commas; for example:
  508.  
  509. [ 17, -0xE20, -518820 ]
  510.  
  511. MFVec2f
  512.  
  513. A multiple-value field that contains any number of two-dimensional vectors.
  514. MFVec2fs are written to file as one or more pairs of floating point values
  515. separated by whitespace. When more than one value is present, all of the
  516. values are enclosed in square brackets and separated by commas; for example:
  517.  
  518. [ 0 0, 1.2 3.4, 98.6 -4e1 ]
  519.  
  520. MFVec3f
  521.  
  522. A multiple-value field that contains any number of three-dimensional
  523. vectors. MFVec3fs are written to file as one or more triples of floating
  524. point values separated by whitespace. When more than one value is present,
  525. all of the values are enclosed in square brackets and separated by commas;
  526. for example:
  527.  
  528. [ 0 0 0, 1.2 3.4 5.6, 98.6 -4e1 212 ]
  529.  
  530.    Nodes
  531.  
  532. VRML defines several different classes of nodes. Most of the nodes can be
  533. classified into one of three categories; shape, property or group. Shape
  534. nodes define the geometry in the scene. Conceptually, they are the only
  535. nodes that draw anything. Property nodes affect the way shapes are drawn.
  536. And grouping nodes gather other nodes together, allowing collections of
  537. nodes to be treated as a single object. Some group nodes also control
  538. whether or not their children are drawn.
  539.  
  540. Nodes may contain zero or more fields. Each node type defines the type,
  541. name, and default value for each of its fields. The default value for the
  542. field is used if a value for the field is not specified in the VRML file.
  543. The order in which the fields of a node are read is not important; for
  544. example, "Cube { width 2 height 4 depth 6 }" and "Cube { height 4 depth 6
  545. width 2 }" are equivalent.
  546.  
  547. Here are the 36 nodes grouped by type. The first group are the shape nodes.
  548. These specify geometry:
  549.  
  550. AsciiText, Cone, Cube, Cylinder, IndexedFaceSet, IndexedLineSet, PointSet,
  551. Sphere,
  552.  
  553. The second group are the properties. These can be further grouped into
  554. properties of the geometry and its appearance, matrix or transform
  555. properties, and cameras and lights: Coordinate3, FontStyle, Info, LOD,
  556. Material, MaterialBinding, Normal, NormalBinding, Texture2,
  557. Texture2Transform, TextureCoordinate2, ShapeHints
  558.  
  559. MatrixTransform, Rotation, Scale, Transform, Translation
  560.  
  561. OrthographicCamera, PerspectiveCamera
  562.  
  563. DirectionalLight, PointLight, SpotLight
  564.  
  565. These are the group nodes:
  566.  
  567. Group, Separator, Switch, TransformSeparator, WWWAnchor
  568.  
  569. Finally, the WWWInline node does not fit neatly into any category.
  570.  
  571. WWWInline
  572.  
  573. AsciiText
  574.  
  575. This node represents strings of text characters from the ASCII coded
  576. character set. The first string is rendered with its baseline at (0,0,0).
  577. All subsequent strings advance y by -(size * spacing). See FontStyle for a
  578. description of the size field. The justification field determines the
  579. placement of the strings in the x dimension. LEFT (the default) places the
  580. left edge of each string at x=0. CENTER places the center of each string at
  581. x=0. RIGHT places the right edge of each string at x=0. Text is rendered
  582. from left to right, top to bottom in the font set by FontStyle. The width
  583. field defines a suggested width constraint for each string. The default is
  584. to use the natural width of each string. Setting any value to 0 indicates
  585. the natural width should be used for that string.
  586.  
  587. The text is transformed by the current cumulative transformation and is
  588. drawn with the current material and texture.
  589.  
  590. Textures are applied to 3D text as follows. The texture origin is at the
  591. origin of the first string, as determined by the justification. The texture
  592. is scaled equally in both S and T dimensions, with the font height
  593. representing 1 unit. S increases to the right. The T origin can occur
  594. anywhere along each character, depending on how that character's outline is
  595. defined.
  596.  
  597. JUSTIFICATION
  598.      LEFT     Align left edge of text to origin
  599.      CENTER   Align center of text to origin
  600.      RIGHT    Align right edge of text to origin
  601.  
  602. FILE FORMAT/DEFAULTS
  603.      AsciiText {
  604.           string         ""    # MFString
  605.           spacing        1     # SFFloat
  606.           justification  LEFT  # SFEnum
  607.           width          0     # MFFloat
  608.      }
  609.  
  610. Cone
  611.  
  612. This node represents a simple cone whose central axis is aligned with the
  613. y-axis. By default, the cone is centered at (0,0,0) and has a size of -1 to
  614. +1 in all three directions. The cone has a radius of 1 at the bottom and a
  615. height of 2, with its apex at 1 and its bottom at -1. The cone has two
  616. parts: the sides and the bottom.
  617.  
  618. The cone is transformed by the current cumulative transformation and is
  619. drawn with the current texture and material.
  620.  
  621. If the current material binding is PER_PART or PER_PART_INDEXED, the first
  622. current material is used for the sides of the cone, and the second is used
  623. for the bottom. Otherwise, the first material is used for the entire cone.
  624.  
  625. When a texture is applied to a cone, it is applied differently to the sides
  626. and bottom. On the sides, the texture wraps counterclockwise (from above)
  627. starting at the back of the cone. The texture has a vertical seam at the
  628. back, intersecting the yz-plane. For the bottom, a circle is cut out of the
  629. texture square and applied to the cone's base circle. The texture appears
  630. right side up when the top of the cone is rotated towards the -Z axis.
  631.  
  632. PARTS
  633.      SIDES       The conical part
  634.      BOTTOM      The bottom circular face
  635.      ALL         All parts
  636.  
  637. FILE FORMAT/DEFAULTS
  638.      Cone {
  639.           parts         ALL     # SFBitMask
  640.           bottomRadius  1       # SFFloat
  641.           height        2       # SFFloat
  642.      }
  643.  
  644. Coordinate3
  645.  
  646. This node defines a set of 3D coordinates to be used by a subsequent
  647. IndexedFaceSet, IndexedLineSet, or PointSet node. This node does not produce
  648. a visible result during rendering; it simply replaces the current
  649. coordinates in the rendering state for subsequent nodes to use.
  650.  
  651. FILE FORMAT/DEFAULTS
  652.      Coordinate3 {
  653.           point  0 0 0  # MFVec3f
  654.      }
  655.  
  656. Cube
  657.  
  658. This node represents a cuboid aligned with the coordinate axes. By default,
  659. the cube is centered at (0,0,0) and measures 2 units in each dimension, from
  660. -1 to +1. The cube is transformed by the current cumulative transformation
  661. and is drawn with the current material and texture.
  662.  
  663. If the current material binding is PER_PART, PER_PART_INDEXED, PER_FACE, or
  664. PER_FACE_INDEXED, materials will be bound to the faces of the cube in this
  665. order: front (+Z), back (-Z), left (-X), right (+X), top (+Y), and bottom
  666. (-Y).
  667.  
  668. Textures are applied individually to each face of the cube; the entire
  669. texture goes on each face. On the front, back, right, and left sides of the
  670. cube, the texture is applied right side up. On the top, the texture appears
  671. right side up when the top of the cube is tilted toward the camera. On the
  672. bottom, the texture appears right side up when the top of the cube is tilted
  673. towards the -Z axis.
  674.  
  675. FILE FORMAT/DEFAULTS
  676.      Cube {
  677.           width   2     # SFFloat
  678.           height  2     # SFFloat
  679.           depth   2     # SFFloat
  680.      }
  681.  
  682. Cylinder
  683.  
  684. This node represents a simple capped cylinder centered around the y-axis. By
  685. default, the cylinder is centered at (0,0,0) and has a default size of -1 to
  686. +1 in all three dimensions. The cylinder has three parts: the sides, the top
  687. (y = +1) and the bottom (y = -1). You can use the radius and height fields
  688. to create a cylinder with a different size.
  689.  
  690. The cylinder is transformed by the current cumulative transformation and is
  691. drawn with the current material and texture.
  692.  
  693. If the current material binding is PER_PART or PER_PART_INDEXED, the first
  694. current material is used for the sides of the cylinder, the second is used
  695. for the top, and the third is used for the bottom. Otherwise, the first
  696. material is used for the entire cylinder.
  697.  
  698. When a texture is applied to a cylinder, it is applied differently to the
  699. sides, top, and bottom. On the sides, the texture wraps counterclockwise
  700. (from above) starting at the back of the cylinder. The texture has a
  701. vertical seam at the back, intersecting the yz-plane. For the top and
  702. bottom, a circle is cut out of the texture square and applied to the top or
  703. bottom circle. The top texture appears right side up when the top of the
  704. cylinder is tilted toward the +Z axis, and the bottom texture appears right
  705. side up when the top of the cylinder is tilted toward the -Z axis.
  706.  
  707. PARTS
  708.      SIDES   The cylindrical part
  709.      TOP     The top circular face
  710.      BOTTOM  The bottom circular face
  711.      ALL     All parts
  712.  
  713. FILE FORMAT/DEFAULTS
  714.      Cylinder {
  715.           parts   ALL   # SFBitMask
  716.           radius  1     # SFFloat
  717.           height  2     # SFFloat
  718.      }
  719.  
  720. DirectionalLight
  721.  
  722. This node defines a directional light source that illuminates along rays
  723. parallel to a given 3-dimensional vector.
  724.  
  725. A light node defines an illumination source that may affect subsequent
  726. shapes in the scene graph, depending on the current lighting style. Light
  727. sources are affected by the current transformation. A light node under a
  728. separator does not affect any objects outside that separator.
  729.  
  730. FILE FORMAT/DEFAULTS
  731.      DirectionalLight {
  732.           on         TRUE       # SFBool
  733.           intensity  1          # SFFloat
  734.           color      1 1 1      # SFColor
  735.           direction  0 0 -1     # SFVec3f
  736.      }
  737.  
  738. FontStyle
  739.  
  740. This node defines the current font style used for all subsequent AsciiText.
  741. Font attributes only are defined. It is up to the browser to assign specific
  742. fonts to the various attribute combinations. The size field specifies the
  743. height (in object space units) of glyphs rendered and determines the
  744. vertical spacing of adjacent lines of text.
  745.  
  746. FAMILY
  747.  
  748.      SERIF       Serif style (such as TimesRoman)
  749.      SANS        Sans Serif Style (such as Helvetica)
  750.      TYPEWRITER  Fixed pitch style (such as Courier)
  751.  
  752. STYLE
  753.      NONE        No modifications to family
  754.      BOLD        Embolden family
  755.      ITALIC      Italicize or Slant family
  756.  
  757. FILE FORMAT/DEFAULTS
  758.      FontStyle {
  759.           size     10      # SFFloat
  760.           family   SERIF   # SFEnum
  761.           style    NONE    # SFBitMask
  762.      }
  763.  
  764. Group
  765.  
  766. This node defines the base class for all group nodes. Group is a node that
  767. contains an ordered list of child nodes. This node is simply a container for
  768. the child nodes and does not alter the traversal state in any way. During
  769. traversal, state accumulated for a child is passed on to each successive
  770. child and then to the parents of the group (Group does not push or pop
  771. traversal state as separator does).
  772.  
  773. FILE FORMAT/DEFAULTS
  774.      Group {
  775.      }
  776.  
  777. IndexedFaceSet
  778.  
  779. This node represents a 3D shape formed by constructing faces (polygons) from
  780. vertices located at the current coordinates. IndexedFaceSet uses the indices
  781. in its coordIndex field to specify the polygonal faces. An index of -1
  782. indicates that the current face has ended and the next one begins.
  783.  
  784. The vertices of the faces are transformed by the current transformation
  785. matrix.
  786.  
  787. Treatment of the current material and normal binding is as follows: The
  788. PER_PART and PER_FACE bindings specify a material or normal for each face.
  789. PER_VERTEX specifies a material or normal for each vertex. The corresponding
  790. _INDEXED bindings are the same, but use the materialIndex or normalIndex
  791. indices. The DEFAULT material binding is equal to OVERALL. The DEFAULT
  792. normal binding is equal to PER_VERTEX_INDEXED; if insufficient normals exist
  793. in the state, vertex normals will be generated automatically.
  794.  
  795. Explicit texture coordinates (as defined by TextureCoordinate2) may be bound
  796. to vertices of an indexed shape by using the indices in the
  797. textureCoordIndex field. As with all vertex-based shapes, if there is a
  798. current texture but no texture coordinates are specified, a default texture
  799. coordinate mapping is calculated using the bounding box of the shape. The
  800. longest dimension of the bounding box defines the S coordinates, and the
  801. next longest defines the T coordinates. The value of the S coordinate ranges
  802. from 0 to 1, from one end of the bounding box to the other. The T coordinate
  803. ranges between 0 and the ratio of the second greatest dimension of the
  804. bounding box to the greatest dimension.
  805.  
  806. Be sure that the indices contained in the coordIndex, materialIndex,
  807. normalIndex, and textureCoordIndex fields are valid with respect to the
  808. current state, or errors will occur.
  809.  
  810. FILE FORMAT/DEFAULTS
  811.      IndexedFaceSet {
  812.           coordIndex         0  # MFLong
  813.           materialIndex      -1 # MFLong
  814.           normalIndex        -1 # MFLong
  815.           textureCoordIndex  -1 # MFLong
  816.      }
  817.  
  818. IndexedLineSet
  819.  
  820. This node represents a 3D shape formed by constructing polylines from
  821. vertices located at the current coordinates. IndexedLineSet uses the indices
  822. in its coordIndex field to specify the polylines. An index of -1 indicates
  823. that the current polyline has ended and the next one begins.
  824.  
  825. The coordinates of the line set are transformed by the current cumulative
  826. transformation.
  827.  
  828. Treatment of the current material and normal binding is as follows: The
  829. PER_PART binding specifies a material or normal for each segment of the
  830. line. The PER_FACE binding specifies a material or normal for each polyline.
  831. PER_VERTEX specifies a material or normal for each vertex. The corresponding
  832. _INDEXED bindings are the same, but use the materialIndex or normalIndex
  833. indices. The DEFAULT material binding is equal to OVERALL. The DEFAULT
  834. normal binding is equal to PER_VERTEX_INDEXED; if insufficient normals exist
  835. in the state, the lines will be drawn unlit. The same rules for texture
  836. coordinate generation as IndexedFaceSet are used.
  837.  
  838. FILE FORMAT/DEFAULTS
  839.      IndexedLineSet {
  840.           coordIndex         0  # MFLong
  841.           materialIndex      -1 # MFLong
  842.           normalIndex        -1 # MFLong
  843.           textureCoordIndex  -1 # MFLong
  844.      }
  845.  
  846. Info
  847.  
  848. This class defines an information node in the scene graph. This node has no
  849. effect during traversal. It is used to store information in the scene graph,
  850. typically for application-specific purposes, copyright messages, or other
  851. strings.
  852.  
  853.      Info {
  854.           string  "<Undefined info>"      # SFString
  855.      }
  856.  
  857. LOD
  858.  
  859. This group node is used to allow applications to switch between various
  860. representations of objects automatically. The children of this node
  861. typically represent the same object or objects at varying levels of detail,
  862. from highest detail to lowest.
  863.  
  864. The specified center point of the LOD is transformed by the current
  865. transformation into world space, and the distance from the transformed
  866. center to the world-space eye point is calculated. If the distance is less
  867. than the first value in the ranges array, then the first child of the LOD
  868. group is drawn. If between the first and second values in the ranges array,
  869. the second child is drawn, etc. If there are N values in the ranges array,
  870. the LOD group should have N+1 children. Specifying too few children will
  871. result in the last child being used repeatedly for the lowest levels of
  872. detail; if too many children are specified, the extra children will be
  873. ignored. Each value in the ranges array should be less than the previous
  874. value, otherwise results are undefined.
  875.  
  876. FILE FORMAT/DEFAULTS
  877.      LOD {
  878.           range [ ]    # MFFloat
  879.           center 0 0 0  # SFVec3f
  880.      }
  881.  
  882. Material
  883.  
  884. This node defines the current surface material properties for all subsequent
  885. shapes. Material sets several components of the current material during
  886. traversal. Different shapes interpret materials with multiple values
  887. differently. To bind materials to shapes, use a MaterialBinding node.
  888.  
  889. FILE FORMAT/DEFAULTS
  890.      Material {
  891.           ambientColor   0.2 0.2 0.2    # MFColor
  892.           diffuseColor   0.8 0.8 0.8    # MFColor
  893.           specularColor  0 0 0          # MFColor
  894.           emissiveColor  0 0 0          # MFColor
  895.           shininess      0.2            # MFFloat
  896.           transparency   0              # MFFloat
  897.      }
  898.  
  899. MaterialBinding
  900.  
  901. This node specifies how the current materials are bound to shapes that
  902. follow in the scene graph. Each shape node may interpret bindings
  903. differently. The current material always has a base value, which is defined
  904. by the first value of all material fields. Since material fields may have
  905. multiple values, the binding determines how these values are distributed
  906. over a shape.
  907.  
  908. The bindings for faces and vertices are meaningful only for shapes that are
  909. made from faces and vertices. Similarly, the indexed bindings are only used
  910. by the shapes that allow indexing.
  911.  
  912. When multiple material values are bound, the values are cycled through,
  913. based on the period of the material component with the most values. For
  914. example, the following table shows the values used when cycling through (or
  915. indexing into) a material with 2 ambient colors, 3 diffuse colors, and 1 of
  916. all other components in the current material. (The period of this material
  917. cycle is 3):
  918.  
  919. Material        Ambient color   Diffuse color   Other
  920.  0                     0               0           0
  921.  1                     1               1           0
  922.  2                     1               2           0
  923.  3 (same as 0)         0               0           0
  924.  
  925. BINDINGS
  926.      DEFAULT            Use default binding
  927.      OVERALL            Whole object has same material
  928.      PER_PART           One material for each part of object
  929.      PER_PART_INDEXED   One material for each part, indexed
  930.      PER_FACE           One material for each face of object
  931.      PER_FACE_INDEXED   One material for each face, indexed
  932.      PER_VERTEX         One material for each vertex of object
  933.      PER_VERTEX_INDEXED One material for each vertex, indexed
  934.  
  935. FILE FORMAT/DEFAULTS
  936.      MaterialBinding {
  937.           value  DEFAULT        # SFEnum
  938.      }
  939.  
  940. MatrixTransform
  941.  
  942. This node defines a geometric 3D transformation with a 4 by 4 matrix. Note
  943. that some matrices (such as singular ones) may result in errors.
  944.  
  945. FILE FORMAT/DEFAULTS
  946.      MatrixTransform {
  947.           matrix  1 0 0 0       # SFMatrix
  948.                   0 1 0 0
  949.                   0 0 1 0
  950.                   0 0 0 1
  951.      }
  952.  
  953. Normal
  954.  
  955. This node defines a set of 3D surface normal vectors to be used by
  956. vertex-based shape nodes (IndexedFaceSet, IndexedLineSet, PointSet) that
  957. follow it in the scene graph. This node does not produce a visible result
  958. during rendering; it simply replaces the current normals in the rendering
  959. state for subsequent nodes to use. This node contains one multiple-valued
  960. field that contains the normal vectors.
  961.  
  962. FILE FORMAT/DEFAULTS
  963.      Normal {
  964.           vector  0 0 1 # MFVec3f
  965.      }
  966.  
  967. NormalBinding
  968.  
  969. This node specifies how the current normals are bound to shapes that follow
  970. in the scene graph. Each shape node may interpret bindings differently.
  971.  
  972. The bindings for faces and vertices are meaningful only for shapes that are
  973. made from faces and vertices. Similarly, the indexed bindings are only used
  974. by the shapes that allow indexing. For bindings that require multiple
  975. normals, be sure to have at least as many normals defined as are necessary;
  976. otherwise, errors will occur.
  977.  
  978. BINDINGS
  979.      DEFAULT            Use default binding
  980.      OVERALL            Whole object has same normal
  981.      PER_PART           One normal for each part of object
  982.      PER_PART_INDEXED   One normal for each part, indexed
  983.      PER_FACE           One normal for each face of object
  984.      PER_FACE_INDEXED   One normal for each face, indexed
  985.      PER_VERTEX         One normal for each vertex of object
  986.      PER_VERTEX_INDEXED One normal for each vertex, indexed
  987.  
  988. FILE FORMAT/DEFAULTS
  989.      NormalBinding {
  990.           value  DEFAULT        # SFEnum
  991.      }
  992.  
  993. OrthographicCamera
  994.  
  995. An orthographic camera defines a parallel projection from a viewpoint. This
  996. camera does not diminish objects with distance, as an PerspectiveCamera
  997. does. The viewing volume for an orthographic camera is a rectangular
  998. parallelepiped (a box).
  999.  
  1000. By default, the camera is located at (0,0,1) and looks along the negative
  1001. z-axis; the position and orientation fields can be used to change these
  1002. values. The height field defines the total height of the viewing volume.
  1003.  
  1004. A camera can be placed in a VRML world to specify the initial location of
  1005. the viewer when that world is entered. VRML browsers will typically modify
  1006. the camera to allow a user to move through the virtual world.
  1007.  
  1008. Cameras are affected by the current transformation, so you can position a
  1009. camera by placing a transformation node before it in the scene graph . The
  1010. default position and orientation of a camera is at (0,0,1) looking along the
  1011. negative z-axis.
  1012.  
  1013. FILE FORMAT/DEFAULTS
  1014.      OrthographicCamera {
  1015.           position         0 0 1        # SFVec3f
  1016.           orientation      0 0 1  0     # SFRotation
  1017.           focalDistance    5            # SFFloat
  1018.           height           2            # SFFloat
  1019.      }
  1020.  
  1021. PerspectiveCamera
  1022.  
  1023. A perspective camera defines a perspective projection from a viewpoint. The
  1024. viewing volume for a perspective camera is a truncated right pyramid.
  1025.  
  1026. By default, the camera is located at (0,0,1) and looks along the negative
  1027. z-axis; the position and orientation fields can be used to change these
  1028. values. The heightAngle field defines the total vertical angle of the
  1029. viewing volume.
  1030.  
  1031. See more on cameras in the OrthographicCamera description.
  1032.  
  1033. FILE FORMAT/DEFAULTS
  1034.      PerspectiveCamera {
  1035.           position         0 0 1        # SFVec3f
  1036.           orientation      0 0 1  0     # SFRotation
  1037.           focalDistance    5            # SFFloat
  1038.           heightAngle      0.785398     # SFFloat
  1039.      }
  1040.  
  1041. PointLight
  1042.  
  1043. This node defines a point light source at a fixed 3D location. A point
  1044. source illuminates equally in all directions; that is, it is omni-
  1045. directional.
  1046.  
  1047. A light node defines an illumination source that may affect subsequent
  1048. shapes in the scene graph, depending on the current lighting style. Light
  1049. sources are affected by the current transformation. A light node under a
  1050. separator does not affect any objects outside that separator.
  1051.  
  1052. FILE FORMAT/DEFAULTS
  1053.      PointLight {
  1054.           on         TRUE       # SFBool
  1055.           intensity  1          # SFFloat
  1056.           color      1 1 1      # SFColor
  1057.           location   0 0 1      # SFVec3f
  1058.      }
  1059.  
  1060. PointSet
  1061.  
  1062. This node represents a set of points located at the current coordinates.
  1063. PointSet uses the current coordinates in order, starting at the index
  1064. specified by the startIndex field. The number of points in the set is
  1065. specified by the numPoints field. A value of -1 for this field indicates
  1066. that all remaining values in the current coordinates are to be used as
  1067. points.
  1068.  
  1069. The coordinates of the point set are transformed by the current cumulative
  1070. transformation. The points are drawn with the current material and texture.
  1071.  
  1072. Treatment of the current material and normal binding is as follows:
  1073. PER_PART, PER_FACE, and PER_VERTEX bindings bind one material or normal to
  1074. each point. The DEFAULT material binding is equal to OVERALL. The DEFAULT
  1075. normal binding is equal to PER_VERTEX. The startIndex is also used for
  1076. materials or normals when the binding indicates that they should be used per
  1077. vertex.
  1078.  
  1079. FILE FORMAT/DEFAULTS
  1080.      PointSet {
  1081.           startIndex  0 # SFLong
  1082.           numPoints   -1        # SFLong
  1083.      }
  1084.  
  1085. Rotation
  1086.  
  1087. This node defines a 3D rotation about an arbitrary axis through the origin.
  1088. The rotation is accumulated into the current transformation, which is
  1089. applied to subsequent shapes.
  1090.  
  1091. FILE FORMAT/DEFAULTS
  1092.      Rotation {
  1093.           rotation  0 0 1  0    # SFRotation
  1094.      }
  1095.  
  1096. See rotation field description for more information.
  1097.  
  1098. Scale
  1099.  
  1100. This node defines a 3D scaling about the origin. If the components of the
  1101. scaling vector are not all the same, this produces a non-uniform scale.
  1102.  
  1103. FILE FORMAT/DEFAULTS
  1104.      Scale {
  1105.           scaleFactor  1 1 1    # SFVec3f
  1106.      }
  1107.  
  1108. Separator
  1109.  
  1110. This group node performs a push (save) of the traversal state before
  1111. traversing its children and a pop (restore) after traversing them. This
  1112. isolates the separator's children from the rest of the scene graph. A
  1113. separator can include lights, cameras, coordinates, normals, bindings, and
  1114. all other properties.
  1115.  
  1116. Separators can also perform render culling. Render culling skips over
  1117. traversal of the separator's children if they are not going to be rendered,
  1118. based on the comparison of the separator's bounding box with the current
  1119. view volume. Culling is controlled by the renderCulling field. These are set
  1120. to AUTO by default, allowing the implementation to decide whether or not to
  1121. cull.
  1122.  
  1123. CULLING ENUMS
  1124.      ON    Always try to cull to the view volume
  1125.      OFF   Never try to cull to the view volume
  1126.      AUTO  Implementation-defined culling behavior
  1127.  
  1128. FILE FORMAT/DEFAULTS
  1129.      Separator {
  1130.           renderCulling       AUTO      # SFEnum
  1131.      }
  1132.  
  1133. ShapeHints
  1134.  
  1135. The ShapeHints node indicates that IndexedFaceSets are solid, contain
  1136. ordered vertices, or contain convex faces.
  1137.  
  1138. These hints allow VRML implementations to optimize certain rendering
  1139. features. Optimizations that may be performed include enabling back-face
  1140. culling and disabling two-sided lighting. For example, if an object is solid
  1141. and has ordered vertices, an implementation may turn on backface culling and
  1142. turn off two-sided lighting. If the object is not solid but has ordered
  1143. vertices, it may turn off backface culling and turn on two-sided lighting.
  1144.  
  1145. The ShapeHints node also affects how default normals are generated. When an
  1146. IndexedFaceSet has to generate default normals, it uses the creaseAngle
  1147. field to determine which edges should be smoothly shaded and which ones
  1148. should have a sharp crease. The crease angle is the angle between surface
  1149. normals on adjacent polygons. For example, a crease angle of .5 radians (the
  1150. default value) means that an edge between two adjacent polygonal faces will
  1151. be smooth shaded if the normals to the two faces form an angle that is less
  1152. than .5 radians (about 30 degrees). Otherwise, it will be faceted.
  1153.  
  1154. VERTEX ORDERING ENUMS
  1155.      UNKNOWN_ORDERING    Ordering of vertices is unknown
  1156.      CLOCKWISE           Face vertices are ordered clockwise
  1157.                           (from the outside)
  1158.      COUNTERCLOCKWISE    Face vertices are ordered counterclockwise
  1159.                           (from the outside)
  1160.  
  1161. SHAPE TYPE ENUMS
  1162.      UNKNOWN_SHAPE_TYPE  Nothing is known about the shape
  1163.      SOLID               The shape encloses a volume
  1164.  
  1165. FACE TYPE ENUMS
  1166.      UNKNOWN_FACE_TYPE   Nothing is known about faces
  1167.      CONVEX              All faces are convex
  1168.  
  1169. FILE FORMAT/DEFAULTS
  1170.      ShapeHints {
  1171.           vertexOrdering  UNKNOWN_ORDERING      # SFEnum
  1172.           shapeType       UNKNOWN_SHAPE_TYPE    # SFEnum
  1173.           faceType        CONVEX                # SFEnum
  1174.           creaseAngle     0.5                   # SFFloat
  1175.      }
  1176.  
  1177. Sphere
  1178.  
  1179. This node represents a sphere. By default, the sphere is centered at the
  1180. origin and has a radius of 1. The sphere is transformed by the current
  1181. cumulative transformation and is drawn with the current material and
  1182. texture.
  1183.  
  1184. A sphere does not have faces or parts. Therefore, the sphere ignores
  1185. material and normal bindings, using the first material for the entire sphere
  1186. and using its own normals. When a texture is applied to a sphere, the
  1187. texture covers the entire surface, wrapping counterclockwise from the back
  1188. of the sphere. The texture has a seam at the back on the yz-plane.
  1189.  
  1190. FILE FORMAT/DEFAULTS
  1191.      Sphere {
  1192.           radius  1     # SFFloat
  1193.      }
  1194.  
  1195. SpotLight
  1196.  
  1197. This node defines a spotlight light source. A spotlight is placed at a fixed
  1198. location in 3-space and illuminates in a cone along a particular direction.
  1199. The intensity of the illumination drops off exponentially as a ray of light
  1200. diverges from this direction toward the edges of the cone. The rate of
  1201. drop-off and the angle of the cone are controlled by the dropOffRate and
  1202. cutOffAngle fields.
  1203.  
  1204. A light node defines an illumination source that may affect subsequent
  1205. shapes in the scene graph, depending on the current lighting style. Light
  1206. sources are affected by the current transformation. A light node under a
  1207. separator does not affect any objects outside that separator.
  1208.  
  1209. FILE FORMAT/DEFAULTS
  1210.      SpotLight {
  1211.           on           TRUE     # SFBool
  1212.           intensity    1        # SFFloat
  1213.           color        1 1 1    # SFVec3f
  1214.           location     0 0 1    # SFVec3f
  1215.           direction    0 0 -1   # SFVec3f
  1216.           dropOffRate  0        # SFFloat
  1217.           cutOffAngle  0.785398 # SFFloat
  1218.      }
  1219.  
  1220. Switch
  1221.  
  1222. This group node traverses one, none, or all of its children. One can use
  1223. this node to switch on and off the effects of some properties or to switch
  1224. between different properties.
  1225.  
  1226. The whichChild field specifies the index of the child to traverse, where the
  1227. first child has index 0.
  1228.  
  1229. A value of -1 (the default) means do not traverse any children. A value of
  1230. -3 traverses all children, making the switch behave exactly like a regular
  1231. Group.
  1232.  
  1233. FILE FORMAT/DEFAULTS
  1234.      Switch {
  1235.           whichChild  -1        # SFLong
  1236.      }
  1237.  
  1238. Texture2
  1239.  
  1240. This property node defines a texture map and parameters for that map. This
  1241. map is used to apply texture to subsequent shapes as they are rendered.
  1242.  
  1243. The texture can be read from the URL specified by the filename field. To
  1244. turn off texturing, set the filename field to an empty string ("").
  1245.  
  1246. Textures can also be specified inline by setting the image field to contain
  1247. the texture data. Specifying both a URL and data inline will result in
  1248. undefined behavior.
  1249.  
  1250. WRAP ENUM
  1251.      REPEAT  Repeats texture outside 0-1 texture coordinate range
  1252.      CLAMP   Clamps texture coordinates to lie within 0-1 range
  1253.  
  1254. FILE FORMAT/DEFAULTS
  1255.      Texture2 {
  1256.           filename    ""        # SFString
  1257.           image       0 0 0     # SFImage
  1258.           wrapS       REPEAT    # SFEnum
  1259.           wrapT       REPEAT    # SFEnum
  1260.      }
  1261.  
  1262. Texture2Transform
  1263.  
  1264. This node defines a 2D transformation applied to texture coordinates. This
  1265. affects the way textures are applied to the surfaces of subsequent shapes.
  1266. The transformation consists of (in order) a non-uniform scale about an
  1267. arbitrary center point, a rotation about that same point, and a translation.
  1268. This allows a user to change the size and position of the textures on
  1269. shapes.
  1270.  
  1271. FILE FORMAT/DEFAULTS
  1272.      Texture2Transform {
  1273.           translation  0 0      # SFVec2f
  1274.           rotation     0        # SFFloat
  1275.           scaleFactor  1 1      # SFVec2f
  1276.           center       0 0      # SFVec2f
  1277.      }
  1278.  
  1279. TextureCoordinate2
  1280.  
  1281. This node defines a set of 2D coordinates to be used to map textures to the
  1282. vertices of subsequent PointSet, IndexedLineSet, or IndexedFaceSet objects.
  1283. It replaces the current texture coordinates in the rendering state for the
  1284. shapes to use.
  1285.  
  1286. Texture coordinates range from 0 to 1 across the texture. The horizontal
  1287. coordinate, called S, is specified first, followed by the vertical
  1288. coordinate, T.
  1289.  
  1290. FILE FORMAT/DEFAULTS
  1291.      TextureCoordinate2 {
  1292.           point  0 0    # MFVec2f
  1293.      }
  1294.  
  1295. Transform
  1296.  
  1297. This node defines a geometric 3D transformation consisting of (in order) a
  1298. (possibly) non-uniform scale about an arbitrary point, a rotation about an
  1299. arbitrary point and axis, and a translation.
  1300.  
  1301. FILE FORMAT/DEFAULTS
  1302.      Transform {
  1303.           translation       0 0 0       # SFVec3f
  1304.           rotation          0 0 1  0    # SFRotation
  1305.           scaleFactor       1 1 1       # SFVec3f
  1306.           scaleOrientation  0 0 1  0    # SFRotation
  1307.           center            0 0 0       # SFVec3f
  1308.      }
  1309.  
  1310. The transform node
  1311.  
  1312. Transform {
  1313.     translation T1
  1314.     rotation R1
  1315.     scaleFactor S
  1316.     scaleOrientation R2
  1317.     center T2
  1318.   }
  1319.  
  1320. is equivalent to the sequence
  1321.  
  1322. Translation { translation T1 }
  1323. Translation { translation T2 }
  1324. Rotation { rotation R1 }
  1325. Rotation { rotation R2 }
  1326. Scale { scaleFactor S }
  1327. Rotation { rotation -R2 }
  1328. Translation { translation -T2 }
  1329.  
  1330. TransformSeparator
  1331.  
  1332. This group node is similar to the separator node in that it saves state
  1333. before traversing its children and restores it afterwards. However, it saves
  1334. only the current transformation; all other state is left as is. This node
  1335. can be useful for positioning a camera, since the transformations to the
  1336. camera will not affect the rest of the scene, even through the camera will
  1337. view the scene. Similarly, this node can be used to isolate transformations
  1338. to light sources or other objects.
  1339.  
  1340. FILE FORMAT/DEFAULTS
  1341.      TransformSeparator {
  1342.      }
  1343.  
  1344. Translation
  1345.  
  1346. This node defines a translation by a 3D vector.
  1347.  
  1348. FILE FORMAT/DEFAULTS
  1349.      Translation {
  1350.           translation  0 0 0    # SFVec3f
  1351.      }
  1352.  
  1353. WWWAnchor
  1354.  
  1355. The WWWAnchor group node loads a new scene into a VRML browser when one of
  1356. its children is chosen. Exactly how a user "chooses" a child of the
  1357. WWWAnchor is up to the VRML browser; typically, clicking on one of its
  1358. children with the mouse will result in the new scene replacing the current
  1359. scene. A WWWAnchor with an empty ("") name does nothing when its children
  1360. are chosen. The name is an arbitrary URL.
  1361.  
  1362. WWWAnchor behaves like a Separator, pushing the traversal state before
  1363. traversing its children and popping it afterwards.
  1364.  
  1365. The description field in the WWWAnchor allows for a friendly prompt to be
  1366. displayed as an alternative to the URL in the name field. Ideally, browsers
  1367. will allow the user to choose the description, the URL or both to be
  1368. displayed for a candidate WWWAnchor.
  1369.  
  1370. The WWWAnchor's map field is an enumerated value that can be either NONE
  1371. (the default) or POINT. If it is POINT then the object-space coordinates of
  1372. the point on the object the user chose will be added to the URL in the name
  1373. field, with the syntax "?x,y,z".
  1374.  
  1375. MAP ENUM
  1376.      NONE  Do not add information to the URL
  1377.      POINT Add object-space coordinates to URL
  1378.  
  1379. FILE FORMAT/DEFAULTS
  1380.      WWWAnchor {
  1381.           name ""        # SFString
  1382.           description "" # SFString
  1383.           map NONE       # SFEnum
  1384.      }
  1385.  
  1386. WWWInline
  1387.  
  1388. The WWWInline node reads its children from anywhere in the World Wide Web.
  1389. Exactly when its children are read is not defined; reading the children may
  1390. be delayed until the WWWInline is actually displayed. A WWWInline with an
  1391. empty name does nothing. The name is an arbitrary URL.
  1392.  
  1393. The effect of referring to a non-VRML URL in a WWWInline node is undefined.
  1394.  
  1395. If the WWWInline's bboxSize field specifies a non-empty bounding box (a
  1396. bounding box is non-empty if at least one of its dimensions is greater than
  1397. zero), then the WWWInline's object-space bounding box is specified by its
  1398. bboxSize and bboxCenter fields. This allows an implementation to view-volume
  1399. cull or LOD switch the WWWInline without reading its contents.
  1400.  
  1401. FILE FORMAT/DEFAULTS
  1402.      WWWInline {
  1403.           name ""               # SFString
  1404.           bboxSize 0 0 0        # SFVec3f
  1405.           bboxCenter 0 0 0      # SFVec3f
  1406.      }
  1407.  
  1408.    Instancing
  1409.  
  1410. A node may be the child of more than one group. This is called "instancing"
  1411. (using the same instance of a node multiple times, called "aliasing" or
  1412. "multiple references" by other systems), and is accomplished by using the
  1413. "USE" keyword.
  1414.  
  1415. The DEF keyword both defines a named node, and creates a single instance of
  1416. it. The USE keyword indicates that the most recently defined instance should
  1417. be used again. If several nodes were given the same name, then the last DEF
  1418. encountered during parsing "wins". DEF/USE is limited to a single file;
  1419. there is no mechanism for USE'ing nodes that are DEF'ed in other files.
  1420.  
  1421. A name goes into scope as soon as the DEF is encountered, and does not go
  1422. out of scope until another DEF of the same name or end-of-file are
  1423. encountered. Nodes cannot be shared between files (you cannot USE a node
  1424. that was DEF'ed inside the file to which a WWWInline refers).
  1425.  
  1426. For example, rendering this scene will result in three spheres being drawn.
  1427. Both of the spheres are named 'Joe'; the second (smaller) sphere is drawn
  1428. twice:
  1429.  
  1430. Separator {
  1431.         DEF Joe Sphere { }
  1432.         Translation { translation 2 0 0 }
  1433.         Separator {
  1434.                 DEF Joe Sphere { radius .2 }
  1435.                 Translation { translation 2 0 0 }
  1436.         }
  1437.         USE Joe    # radius .2 sphere will be used here
  1438.  
  1439.  
  1440.    Extensibility
  1441.  
  1442. Extensions to VRML are supported by supporting self-describing nodes. Nodes
  1443. that are not part of standard VRML must write out a description of their
  1444. fields first, so that all VRML implementations are able to parse and ignore
  1445. the extensions.
  1446.  
  1447. This description is written just after the opening curly-brace for the node,
  1448. and consists of the keyword 'fields' followed by a list of the types and
  1449. names of fields used by that node, all enclosed in square brackets and
  1450. separated by commas. For example, if Cube was not a standard VRML node, it
  1451. would be written like this:
  1452.  
  1453. Cube {
  1454.   fields [ SFFloat width, SFFloat height, SFFloat depth ]
  1455.   width 10 height 4 depth 3
  1456.  
  1457.  
  1458. Specifying the fields for nodes that ARE part of standard VRML is not an
  1459. error; VRML parsers must silently ignore the field specification.
  1460.  
  1461. Is-a relationships
  1462.  
  1463. A new node type may also be a superset of an existing node that is part of
  1464. the standard. In this case, if an implementation for the new node type
  1465. cannot be found the new node type can be safely treated as as the existing
  1466. node it is based on (with some loss of functionality, of course). To support
  1467. this, new node types can define an MFString field called 'isA' containing
  1468. the names of the types of which it is a superset. For example, a new type of
  1469. Material called "ExtendedMaterial" that adds index of refraction as a
  1470. material property can be written as:
  1471.  
  1472. ExtendedMaterial {
  1473.   fields [ MFString isA, MFFloat indexOfRefraction,
  1474.            MFColor ambientColor, MFColor diffuseColor,
  1475.            MFColor specularColor, MFColor emissiveColor,
  1476.            MFFloat shininess, MFFloat transparency ]
  1477.   isA [ "Material" ]
  1478.   indexOfRefraction .34
  1479.   diffuseColor .8 .54 1
  1480.  
  1481.  
  1482. Multiple is-a relationships may be specified in order of preference;
  1483. implementations are expected to use the first for which there is an
  1484. implementation.
  1485.  
  1486.    An Example
  1487.  
  1488. This is a longer example of a VRML scene. It contains a simple model of a
  1489. track-light consisting of primitive shapes, plus three walls (built out of
  1490. polygons) and a reference to a shape defined elsewhere, both of which are
  1491. illuminated by a spotlight. The shape acts as a hyperlink to some HTML text.
  1492.  
  1493. #VRML V1.0 ascii
  1494.  
  1495. Separator {
  1496.     Separator {       # Simple track-light geometry:
  1497.         Translation { translation 0 4 0 }
  1498.         Separator {
  1499.             Material { emissiveColor 0.1 0.3 0.3 }
  1500.             Cube {
  1501.                 width   0.1
  1502.                 height  0.1
  1503.                 depth   4
  1504.             }
  1505.         }
  1506.         Rotation { rotation 0 1 0  1.57079 }
  1507.         Separator {
  1508.             Material { emissiveColor 0.3 0.1 0.3 }
  1509.             Cylinder {
  1510.                 radius  0.1
  1511.                 height  .2
  1512.             }
  1513.         }
  1514.         Rotation { rotation -1 0 0  1.57079 }
  1515.         Separator {
  1516.             Material { emissiveColor 0.3 0.3 0.1 }
  1517.             Rotation { rotation 1 0 0  1.57079 }
  1518.             Translation { translation 0 -.2 0 }
  1519.             Cone {
  1520.                 height  .4
  1521.                 bottomRadius .2
  1522.             }
  1523.             Translation { translation 0 .4 0 }
  1524.             Cylinder {
  1525.                 radius  0.02
  1526.                 height  .4
  1527.             }
  1528.         }
  1529.     }
  1530.     SpotLight {      # Light from above
  1531.         location 0 4 0
  1532.         direction 0 -1 0
  1533.         intensity       0.9
  1534.         cutOffAngle     0.7
  1535.     }
  1536.     Separator {      # Wall geometry; just three flat polygons
  1537.         Coordinate3 {
  1538.             point [
  1539.                    -2 0 -2, -2 0 2, 2 0 2, 2 0 -2,
  1540.                    -2 4 -2, -2 4 2, 2 4 2, 2 4 -2]
  1541.         }
  1542.         IndexedFaceSet {
  1543.             coordIndex [ 0, 1, 2, 3, -1,
  1544.                         0, 4, 5, 1, -1,
  1545.                         0, 3, 7, 4, -1
  1546.                         ]
  1547.         }
  1548.     }
  1549.     WWWAnchor {   # A hyperlinked cow:
  1550.         name "http://www.foo.edu/CowProject/AboutCows.html"
  1551.  
  1552.         Separator {
  1553.             Translation { translation 0 1 0 }
  1554.             WWWInline {   # Reference another object
  1555.                 name "http://www.foo.edu/3DObjects/cow.wrl"
  1556.             }
  1557.         }
  1558.     }
  1559.  
  1560.  
  1561. ----------------------------------------------------------------------------
  1562.  
  1563.    Browser Considerations
  1564.  
  1565. This section describes the file naming and MIME conventions to be used in
  1566. building VRML browsers and configuring WWW browsers to work with them.
  1567.  
  1568.    File Extensions
  1569.  
  1570. The file extension for VMRL files is .wrl (for world).
  1571.  
  1572.    MIME
  1573.  
  1574. The MIME type for VRML files is defined as follows:
  1575.  
  1576. x-world/x-vrml
  1577.  
  1578. The MIME major type for 3D world descriptions is x-world. The MIME minor
  1579. type for VRML documents is x-vrml. Other 3D world descriptions, such as oogl
  1580. for The Geometry Center's Object-Oriented Geometry Language, or iv, for
  1581. SGI's Open Inventor ASCII format, can be supported by using different MIME
  1582. minor types.
  1583.  
  1584. [--] 26-MAY-95
  1585.