Commit a252d301 authored by Mandic's avatar Mandic
Browse files

Update indexedfaceset.html

parent a852031d
Pipeline #6431 passed with stages
in 11 seconds
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Indexed Face Set </title> <title> Indexed Face Set </title>
<link rel="stylesheet" type="text/css" href="x3dom.css"> <link rel="stylesheet" type="text/css" href="x3dom.css">
</link> </link>
</head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/vs.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
<body> <script>hljs.highlightAll();</script>
<h1> Indexed Face Set </h1> </head>
<table width="100%" height="85%" border="0">
<tr> <body>
<td width="50%" align="center" valign="top" scope="col"> <h1> Indexed Face Set </h1>
<X3D id="shapedata" width="600px" height="600px" style="float:left"> <table width="100%" height="85%" border="0">
<Scene> <tr>
<Shape> <td width="50%" align="center" valign="top" scope="col">
<Appearance> <X3D id="shapedata" width="600px" height="600px" style="float:left">
<Material diffuseColor="0.5 0.5 0.5"> </Material> <Scene>
</Appearance> <Shape>
<IndexedFaceSet solid="true" ccw="true" coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 <Appearance>
3 0 4 7 -1 0 3 2 1 -1 7 4 8 -1 <Material diffuseColor="0.5 0.5 0.5"> </Material>
4 5 8 -1 5 6 8 -1 6 7 8 -1"> </Appearance>
<Coordinate point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1, <IndexedFaceSet solid="true" ccw="true" coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 "> 3 0 4 7 -1 0 3 2 1 -1 7 4 8 -1
</Coordinate> 4 5 8 -1 5 6 8 -1 6 7 8 -1">
</IndexedFaceSet> <Coordinate point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1,
</Shape> -1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 ">
<!-- add points (as spheres) and labels --> </Coordinate>
<!-- P0 --> </IndexedFaceSet>
<Transform translation='-1 0 1'> </Shape>
<Shape DEF='Point'> <!-- add points (as spheres) and labels -->
<Appearance DEF='Green'> <!-- P0 -->
<Material diffuseColor='0 1 0'> </Material> <Transform translation='-1 0 1'>
</Appearance> <Shape DEF='Point'>
<Sphere radius="0.1"> </Sphere> <Appearance DEF='Green'>
</Shape> <Material diffuseColor='0 1 0'> </Material>
<Transform translation='0 -0.75 0'> </Appearance>
<Billboard> <Sphere radius="0.1"> </Sphere>
<Shape> </Shape>
<Appearance DEF='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
<Material diffuseColor='0 0 0'> </Material> <Billboard>
</Appearance> <Shape>
<Text string='"P0"'> <Appearance DEF='LABEL_APPEARANCE'>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Material diffuseColor='0 0 0'> </Material>
</Text> </Appearance>
</Shape> <Text string='"P0"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P1 --> </Billboard>
<Transform translation='1 0 1'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P1 -->
<Transform translation='0 -0.75 0'> <Transform translation='1 0 1'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
</Appearance> <Billboard>
<Text string='"P1"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P1"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P2 --> </Billboard>
<Transform translation='1 0 -1'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P2 -->
<Transform translation='0 -0.75 0'> <Transform translation='1 0 -1'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
</Appearance> <Billboard>
<Text string='"P2"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P2"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P3 --> </Billboard>
<Transform translation='-1 0 -1'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P3 -->
<Transform translation='0 -0.75 0'> <Transform translation='-1 0 -1'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
</Appearance> <Billboard>
<Text string='"P3"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P3"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P4 --> </Billboard>
<Transform translation='-1 2 1'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P4 -->
<Transform translation='0 -0.75 0'> <Transform translation='-1 2 1'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
</Appearance> <Billboard>
<Text string='"P4"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P4"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P5 --> </Billboard>
<Transform translation='1 2 1'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P5 -->
<Transform translation='0 -0.75 0'> <Transform translation='1 2 1'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
</Appearance> <Billboard>
<Text string='"P5"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P5"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P6 --> </Billboard>
<Transform translation='1 2 -1'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P6 -->
<Transform translation='0 -0.75 0'> <Transform translation='1 2 -1'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
</Appearance> <Billboard>
<Text string='"P6"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P6"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P7 --> </Billboard>
<Transform translation='-1 2 -1'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P7 -->
<Transform translation='0 -0.75 0'> <Transform translation='-1 2 -1'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 -0.75 0'>
</Appearance> <Billboard>
<Text string='"P7"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P7"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
<!-- P8 --> </Billboard>
<Transform translation='0 3 0'> </Transform>
<Shape USE="Point"> </Transform>
</Shape> <!-- P8 -->
<Transform translation='0 0.0 0'> <Transform translation='0 3 0'>
<Billboard> <Shape USE="Point">
<Shape> </Shape>
<Appearance USE='LABEL_APPEARANCE'> <Transform translation='0 0.0 0'>
</Appearance> <Billboard>
<Text string='"P8"'> <Shape>
<FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle> <Appearance USE='LABEL_APPEARANCE'>
</Text> </Appearance>
</Shape> <Text string='"P8"'>
</Billboard> <FontStyle DEF='LABEL_FONT' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='.2'> </FontStyle>
</Transform> </Text>
</Transform> </Shape>
</Scene> </Billboard>
</X3D> </Transform>
</td> </Transform>
<td width="50%" align="left" valign="top" scope="col"> </Scene>
An IndexedFaceSet is used to define a polygonal shape. For example, it can be used to model a building. </X3D>
The building geometry is given by a set of points P={P0, P1, ..., Pn} </p>
and a set of polygons F={F0, F1, ..., Fm}. Each point Pi is given by its coordinates Pi=(xi,yi,zi). </td>
Each polygon Fi is defined by a list of m coplanar points (m >=3) given in counterclockwise order: <td width="50%" align="left" valign="top" scope="col">
Fi=(Pi0, Pi1, ... Pim) An IndexedFaceSet is used to define a polygonal shape. For example, it can be used to model a building.
<pre> The building geometry is given by a set of points P={P0, P1, ..., Pn}
Example: and a set of polygons F={F0, F1, ..., Fm}. Each point Pi is given by its coordinates Pi=(xi,yi,zi).
P = {P0, P1, P2, P3, P4, P5, P6, P7, P8} Each polygon Fi is defined by a list of m coplanar points (m >=3) given in counterclockwise order:
with Fi=(Pi0, Pi1, ... Pim)
P0 = (-1.0, 0.0, 1.0) <pre>
P1 = ( 1.0, 0.0, 1.0) Example:
P2 = ( 1.0, 0.0, -1.0) P = {P0, P1, P2, P3, P4, P5, P6, P7, P8}
P3 = (-1.0, 0.0, -1.0) with
P4 = (-1.0, 2.0, 1.0) P0 = (-1.0, 0.0, 1.0)
P5 = ( 1.0, 2.0, 1.0) P1 = ( 1.0, 0.0, 1.0)
P6 = ( 1.0, 2.0, -1.0) P2 = ( 1.0, 0.0, -1.0)
P7 = (-1.0, 2.0, -1.0) P3 = (-1.0, 0.0, -1.0)
P8 = ( 0.0, 3.0, 0.0) P4 = (-1.0, 2.0, 1.0)
F = {F0, F1, F2, F3, F4, F5, F6, F7, F8} P5 = ( 1.0, 2.0, 1.0)
wall: P6 = ( 1.0, 2.0, -1.0)
F0 = (P0, P1, P5, P4) P7 = (-1.0, 2.0, -1.0)
F1 = (P1, P2, P6, P5) P8 = ( 0.0, 3.0, 0.0)
F2 = (P2, P3, P7, P6) F = {F0, F1, F2, F3, F4, F5, F6, F7, F8}
F3 = (P3, P0, P4, P7) wall:
ground: F0 = (P0, P1, P5, P4)
F4 = (P0, P3, P2, P1) F1 = (P1, P2, P6, P5)
roof: F2 = (P2, P3, P7, P6)
F5 = (P7, P4, P8) F3 = (P3, P0, P4, P7)
F6 = (P4, P5, P8) ground:
F7 = (P5, P6, P8) F4 = (P0, P3, P2, P1)
F8 = (P6, P7, P8) roof:
</pre> F5 = (P7, P4, P8)
<br> F6 = (P4, P5, P8)
In the IndexedFaceSet the point set P is defined in the Coordinate node. F7 = (P5, P6, P8)
The set of polygons F is defined in the attribute coordIndex. Each polygon is given by a list of point indices F8 = (P6, P7, P8)
followed by -1 to indicate the end of a polygon and the beginning of a new one. </pre>
<br> <br>
<pre class="prettyprint"> In the IndexedFaceSet the point set P is defined in the Coordinate node.
&lt;X3D id="shapedata" width="600px" height="600px" style="float:left"&gt; The set of polygons F is defined in the attribute coordIndex. Each polygon is given by a list of point indices
&lt;Scene&gt; followed by -1 to indicate the end of a polygon and the beginning of a new one.
&lt;Shape&gt; <br>
&lt;Appearance&gt; <pre>
&lt;Material diffuseColor="0.5 0.5 0.5"&gt; &lt;/Material&gt; <code class="language-html">
&lt;/Appearance&gt; &lt;html&gt;
&lt;IndexedFaceSet solid="true" ccw ="true" &lt;head&gt;
coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 &lt;title&gt;My first X3DOM page&lt;/title&gt;
3 0 4 7 -1 0 3 2 1 -1 7 4 8 -1 &lt;script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'&gt; &lt;/script&gt;
4 5 8 -1 5 6 8 -1 6 7 8 -1"&gt; &lt;link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'&gt;&lt;/link&gt;
&lt;Coordinate point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1, &lt;/head&gt;
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 " &gt; &lt;body&gt;
&lt;/Coordinate&gt; &lt;X3D id="shapedata" width="600px" height="600px" style="float:left"&gt;
&lt;/IndexedFaceSet&gt; &lt;Scene&gt;
&lt;/Shape&gt; &lt;Shape&gt;
&lt;/Scene&gt; &lt;Appearance&gt;
&lt;/X3D&gt; &lt;Material diffuseColor="0.5 0.5 0.5"&gt; &lt;/Material&gt;
</pre> &lt;/Appearance&gt;
</td> &lt;IndexedFaceSet solid="true" ccw ="true"
</tr> coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1
</table> 3 0 4 7 -1 0 3 2 1 -1 7 4 8 -1
<script type="text/javascript" src="x3dom.js"></script> 4 5 8 -1 5 6 8 -1 6 7 8 -1"&gt;
</body> &lt;Coordinate point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1,
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 " &gt;
</html> &lt;/Coordinate&gt;
\ No newline at end of file &lt;/IndexedFaceSet&gt;
&lt;/Shape&gt;
&lt;/Scene&gt;
&lt;/X3D&gt;
&lt;/body&gt;
&lt;/html&gt;
</code>
</pre>
</td>
<script type="text/javascript" src="x3dom.js"></script>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment