X3D Model Documentation: LineSetComparison.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent='LineSetComparison.x3d'/>
  6            <meta name='creatorcontent='Don Brutzman'/>
  7            <meta name='createdcontent='2 September 2008'/>
  8            <meta name='modifiedcontent='20 October 2019'/>
  9            <meta name='descriptioncontent='A simple wireframe cube, comparing two functionally equivalent nodes: IndexedLineSet (per-vertex coloring) with LineSet (per-segment coloring). Keeping track of how each node "connects the dots" is simply a book-keeping problem.'/>
 10            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/LineSetComparison.x3d'/>
 11            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter13PointsLinesFaces/Figure13.11IndexedLineSetBoxWireframe.x3d'/>
 12            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 13            <meta name='licensecontent='../license.html'/>
 14       </head>
<!--

<!-- -->

<!-- to top Index for DEF node: TextAppearance

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, Viewpoint_3, Viewpoint_4
-->
 15       <Scene>
 16            <WorldInfo title='LineSetComparison.x3d'/>
 17            <Viewpoint description='8m away - note linewidth is unchanged and perspective is ambiguousposition='0 0 8'/>
 18            <Viewpoint description='15m away - note linewidth is unchanged and perspective is ambiguousposition='0 0 15'/>
 19            <Transform translation='-3 0 0'>
 20                 <!-- Rotating a single cube can help show near/far ambiguity, i.e. the optical illusion for constant-pixel-width line structures -->
 21                 <Viewpoint description='IndexedLineSet cube close upposition='0 0 5'/>
 22                 <Shape>
 23                      <!-- The IndexedLineSet builds the same cube as the LineSet,but simply uses a different approach to connect the vertices. -->
 24                      <IndexedLineSet colorPerVertex='falsecoordIndex='0 1 2 3 0 -1 4 5 6 7 4 -1 0 4 -1 1 5 -1 2 6 -1 3 7 -1'>
 25                           <Coordinate point='-1 1 1 1 1 1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 -1'/>
 26                           <Color color='1 0.058824 0.117647 0.878431 0.447059 0 1 0.992157 0.141176 0.101961 0.721569 0 0.12549 0 0.901961 0.878431 0 0.843137 0.294118 0 0.341176 1 0.980392 0.992157 1 1 1'/>
 27                      </IndexedLineSet>
 28                 </Shape>
 29            </Transform>
 30            <Transform translation='3 0 0'>
 31                 <Viewpoint description='LineSet cube close upposition='0 0 5'/>
 32                 <Shape>
 33                      <!-- Coordinate sequence for the vertexCount='5 5 2 2 2 2' array: 0 1 2 3 0, 4 5 6 7 4, 0 4, 1 5, 2 6, 3 7. This corresponds to the IndexedLineSet coordIndex actually. -->
 34                      <LineSet vertexCount='5 5 2 2 2 2containerField='geometry'>
 35                           <Coordinate point='-1 1 1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 -1'/>
 36                           <Color color='1 0 0 1 0.5 0 1 1 0 0 1 0 1 0 0 0 0 1 0.8 0 0.8 0.3 0 0.3 1 1 1 0 0 1 1 0 0 0 0 1 1 0.5 0 0.8 0 0.8 1 1 0 0.3 0 0.3 0 1 0 1 1 1'/>
 37                      </LineSet>
 38                 </Shape>
 39            </Transform>
 40            <Transform translation='-3 2 0'>
 41                 <Shape>
 42                      <Text string='"IndexedLineSet"'>
 43                           <FontStyle justify='"MIDDLE" "MIDDLE"size='0.5'/>
 44                      </Text>
 45 
                    <!-- Appearance TextAppearance is a DEF node that has 1 USE node: USE_1 -->
                    <Appearance DEF='TextAppearance'>
 46                           <Material ambientIntensity='0diffuseColor='0 0 0emissiveColor='0 0.398733 1shininess='0.05specularColor='0.622449 0.622449 0.622449'/>
 47                      </Appearance>
 48                 </Shape>
 49            </Transform>
 50            <Transform translation='3 2 0'>
 51                 <Shape>
 52                      <Text string='"LineSet"'>
 53                           <FontStyle justify='"MIDDLE" "MIDDLE"size='0.5'/>
 54                      </Text>
 55                      <Appearance USE='TextAppearance'/>
 56                 </Shape>
 57            </Transform>
 58       </Scene>
 59  </X3D>
<!--

<!-- -->

<!-- to top Index for DEF node: TextAppearance

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, Viewpoint_3, Viewpoint_4
-->
X3D Tooltips element index: Appearance, Color, Coordinate, FontStyle, head, IndexedLineSet, LineSet, Material, meta, Scene, Shape, Text, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/LineSetComparisonIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/LineSetComparison.x3d -->

<!-- Color legend: X3D terminology <X3dNode DEF='idName' field='value'/> matches XML terminology <XmlElement DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->