Piecing Polygons Together

IndexedFaceSet • Attributes

An open cardboard box with 9 connecting faces.

The ability to list multiple faces together is extremely helpful in creating more complex shapes. However, faces within a set are not required to connect.

IndexedFaceSet is the rough equivalent to SVG Path. It will make just about any shape you need.

Coordinate

 

Rotate the vrignette to view the geometry.

<x3d>

<scene>

<!-- World Info -->
<worldInfo title="X3D IndexedFaceSet Example">
</worldInfo>

<!-- Navigation Info -->
<navigationInfo headlight="true">
</navigationInfo>


<!-- Avatar Viewpoint -->
<viewpoint position="0.0 2.0 15.0">
</viewpoint>

<pointLight location="0.0 10.0 0.0" color="1.0 1.0 1.0" intensity="0.75">
</pointLight>

<!-- Shapes -->
<transform rotation="1 0 0 0.591">
<transform rotation="0 1 0 0.785">
<shape>
<appearance>
<material diffuseColor="0.804 0.624 0.380">
</material>
</appearance>
<indexedFaceSet solid="false" coordIndex="0 1 2 3 4 -1 5 6 7 8 9 -1 10 11 12 13 14 -1 15 16 17 18 19 -1 20 21 22 23 24 -1 25 26 27 28 29 -1 30 31 32 33 34 -1 35 36 37 38 39 -1 40 41 42 43 44">
<coordinate point="-1.5 0.0 -1.5, -1.5 0.0 1.5, 1.5 0.0 1.5, 1.5 0.0 -1.5, -1.5 0.0 -1.5, -1.5 4.0 -1.5, -1.5 0.0 -1.5, 1.5 0.0 -1.5, 1.5 4.0 -1.5, -1.5 4.0 -1.5, 1.5 4.0 -1.5, 1.5 0.0 -1.5,  1.5 0.0 1.5, 1.5 4.0 1.5, 1.5 4.0 -1.5, 1.5 4.0 1.5, 1.5 0.0 1.5, -1.5 0.0 1.5, -1.5 4.0 1.5, 1.5 4.0 1.5, -1.5 4.0 1.5, -1.5 0.0 1.5, -1.5 0.0 -1.5, -1.5 4.0 -1.5, -1.5 4.0 1.5, 1.5 4.0 -1.5, 1.5 4.0 1.5, 3.0 3.5 1.5, 3.0 3.5 -1.5, 1.5 4.0 -1.5, -1.5 4.0 -1.5, 1.5 4.0 -1.5, 1.5 3.5 -3.0, -1.5 3.5 -3.0, -1.5 4.0 -1.5, -1.5 4.0 1.5, -1.5 4.0 -1.5, -3.0 3.5 -1.5, -3.0 3.5 1.5, -1.5 4.0 1.5, 1.5 4.0 1.5, -1.5 4.0 1.5, -1.5 3.5 3.0, 1.5 3.5 3.0, 1.5 4.0 1.5">
</coordinate>
</indexedFaceSet>
</shape>
</transform>
</transform>


<!-- Scene Background -->
<background skyColor="0.20 0.20 0.20" groundColor="0.20 0.20 0.20">
</background>

</scene>
</x3d>