X3D Model Documentation: ColorPerVertexExamples.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='Interchange' 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='ColorPerVertexExamples.x3d'/>
  6            <meta name='descriptioncontent='Geometry Polygons Nodes: Color, Coordinate, IndexedFaceSet, IndexedLineSet, PointSet'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='createdcontent='5 September 2005'/>
  9            <meta name='modifiedcontent='11 May 2021'/>
 10            <meta name='Imagecontent='ColorPerVertexExamples.png'/>
 11            <meta name=' TODO content=' Blender import problems '/>
 12            <meta name='Imagecontent='ColorPerVertexExamplesBlender.png'/>
 13            <meta name=' TODO content=' Xj3D rendering problems '/>
 14            <meta name='Imagecontent='ColorPerVertexExamplesXj3D.png'/>
 15            <meta name='referencecontent='https://www.web3d.org/x3d/tooltips/X3dTooltips.html#IndexedFaceSet'/>
 16            <meta name='referencecontent='https://www.web3d.org/x3d/tooltips/X3dTooltips.html#IndexedLineSet'/>
 17            <meta name='referencecontent='https://www.web3d.org/x3d/tooltips/X3dTooltips.html#Coordinate'/>
 18            <meta name='referencecontent='https://www.web3d.org/x3d/tooltips/X3dTooltips.html#Color'/>
 19            <meta name='rightscontent='Copyright (c) 2005, Daly Realism and Don Brutzman'/>
 20            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ColorPerVertexExamples.x3d'/>
 21            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 22            <meta name='licensecontent='../license.html'/>
 23       </head>
<!--

<!-- -->

<!-- to top Index for DEF nodes: FourColors, FourColorsRGBA, FourPoints

Index for Viewpoint node: Viewpoint_1
-->
 24       <Scene>
 25            <WorldInfo title='ColorPerVertexExamples.x3d'/>
 26            <Viewpoint description='ColorPerVertex Examplesposition='0 0 6'/>
 27            <Background groundColor='0.1 0.1 0.1skyColor='0.1 0.1 0.1'/>
 28            <Transform translation='-0.5 0 0'>
 29                 <Transform translation='-3 0 0'>
 30                      <Shape>
 31                           <!-- Default settings: colorPerVertex='true' and solid='true' (single-sided polygon) -->
 32                           <IndexedFaceSet colorIndex='0 1 2 3 0 -1coordIndex='0 1 2 3 0 -1'>
 33 
                              <!-- Coordinate FourPoints is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
                              <Coordinate DEF='FourPointspoint='0 0 0 1 0 0 1 1 0 0 1 0'/>
 34 
                              <!-- Color FourColors is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                              <Color DEF='FourColorscolor='1 0 0 0 1 0 0 0 1 0.8 0.8 0.8'/>
 35                           </IndexedFaceSet>
 36                      </Shape>
 37                 </Transform>
 38                 <Transform translation='-1 0 0'>
 39                      <Shape>
 40                           <!-- Non-default settings: colorPerVertex='false' and solid='false' (double-sided polygon) -->
 41                           <IndexedFaceSet colorPerVertex='falsesolid='falsecolorIndex='2coordIndex='0 1 2 3 0 -1'>
 42                                <!-- Note that only 4 points are needed to create a 4-vertex polygon. -->
 43                                <Coordinate USE='FourPoints'/>
 44                                <ColorRGBA DEF='FourColorsRGBAcolor='1 0 0 1 0 1 0 1 0 0 1 0.5 0.8 0.8 0.8 0'/>
 45                           </IndexedFaceSet>
 46                      </Shape>
 47                 </Transform>
 48                 <Transform translation='1 0 0'>
 49                      <Shape>
 50                           <!-- Student TODO: try different color indices. -->
 51                           <IndexedLineSet colorIndex='0 1 2 3 0 -1coordIndex='0 1 2 3 0 -1'>
 52                                <Coordinate USE='FourPoints'/>
 53                                <Color USE='FourColors'/>
 54                           </IndexedLineSet>
 55                      </Shape>
 56                 </Transform>
 57                 <Transform translation='3 0 0'>
 58                      <Shape>
 59                           <!-- Note that 5 points are needed to create 4 complete line segments. -->
 60                           <IndexedLineSet colorPerVertex='falsecolorIndex='0coordIndex='0 1 2 3 0 -1'>
 61                                <Coordinate USE='FourPoints'/>
 62                                <Color USE='FourColors'/>
 63                           </IndexedLineSet>
 64                      </Shape>
 65                 </Transform>
 66            </Transform>
 67       </Scene>
 68  </X3D>
<!--

<!-- -->

<!-- to top Index for DEF nodes: FourColors, FourColorsRGBA, FourPoints

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Background, Color, ColorRGBA, Coordinate, head, IndexedFaceSet, IndexedLineSet, meta, Scene, Shape, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ColorPerVertexExamplesIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ColorPerVertexExamples.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. -->