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='title' content='LineSetComparison.x3d'/> |
6 | <meta name='creator' content='Don Brutzman'/> |
7 | <meta name='created' content='2 September 2008'/> |
8 | <meta name='modified' content='20 October 2019'/> |
9 | <meta name='description' content='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='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/LineSetComparison.x3d'/> |
11 | <meta name='reference' content='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter13PointsLinesFaces/Figure13.11IndexedLineSetBoxWireframe.x3d'/> |
12 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
13 | <meta name='license' content='../license.html'/> |
14 | </head> |
15 | <Scene> |
16 | <WorldInfo title='LineSetComparison.x3d'/> |
17 | <Viewpoint description='8m away - note linewidth is unchanged and perspective is ambiguous' position='0 0 8'/> |
18 | <Viewpoint description='15m away - note linewidth is unchanged and perspective is ambiguous' position='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 up' position='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='false' coordIndex='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 up' position='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 2' containerField='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='0' diffuseColor='0 0 0' emissiveColor='0 0.398733 1' shininess='0.05' specularColor='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> |
<!--
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)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->