Commit 89deb070 authored by Mandic's avatar Mandic
Browse files

Update ifsandmaterial.html

parent 2c843732
<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 and material </title> <title> indexed face set and material </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 and material</h1> </head>
<table width="100%" height="85%" border="0">
<tr> <body>
<td width="50%" align="center" valign="top" scope="col"> <h1>indexed face set and material</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">
<!-- roof --> <X3D id="shapedata" width="600px" height="600px" style="float:left">
<Appearance> <Scene>
<Material diffuseColor="0.980, 0.502, 0.447"> </Material> <Shape>
</Appearance> <!-- roof -->
<IndexedFaceSet solid="true" ccw="true" coordIndex=" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1"> <Appearance>
<Coordinate DEF="pointset" point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1, <Material diffuseColor="0.980, 0.502, 0.447"> </Material>
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 "> </Appearance>
</Coordinate> <IndexedFaceSet solid="true" ccw="true" coordIndex=" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1">
</IndexedFaceSet> <Coordinate DEF="pointset" 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 ">
<Shape> </Coordinate>
<!-- wall --> </IndexedFaceSet>
<Appearance> </Shape>
<Material diffuseColor="0.753, 0.753, 0.753"> </Material> <Shape>
</Appearance> <!-- wall -->
<IndexedFaceSet solid="true" ccw="true" coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1"> <Appearance>
<Coordinate USE="pointset"> <Material diffuseColor="0.753, 0.753, 0.753"> </Material>
</Coordinate> </Appearance>
</IndexedFaceSet> <IndexedFaceSet solid="true" ccw="true" coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1">
</Shape> <Coordinate USE="pointset">
<Shape> </Coordinate>
<!-- ground --> </IndexedFaceSet>
<Appearance> </Shape>
<Material diffuseColor="0.180, 0.280, 0.230"> </Material> <Shape>
</Appearance> <!-- ground -->
<IndexedFaceSet solid="true" ccw="true" coordIndex=" 0 3 2 1 -1 "> <Appearance>
<Coordinate USE="pointset"> <Material diffuseColor="0.180, 0.280, 0.230"> </Material>
</Coordinate> </Appearance>
</IndexedFaceSet> <IndexedFaceSet solid="true" ccw="true" coordIndex=" 0 3 2 1 -1 ">
</Shape> <Coordinate USE="pointset">
</Scene> </Coordinate>
</X3D> </IndexedFaceSet>
</td> </Shape>
<td width="50%" align="left" valign="top" scope="col"> </Scene>
One shape has only ony appearance. If different colors for the building elements roof, wall and ground surfaces </X3D>
shall be used, </p>
we need to have different shape for these elements. However, they can share the same point set. The following </td>
example uses different <td width="50%" align="left" valign="top" scope="col">
Material for roo, wall, and ground surfaces. One shape has only ony appearance. If different colors for the building elements roof, wall and ground surfaces
<br> shall be used,
<pre class="prettyprint"> we need to have different shape for these elements. However, they can share the same point set. The following
&lt;X3D id="shapedata" width="600px" height="600px" style="float:left"&gt; example uses different
&lt;Scene&gt; Material for roof, wall, and ground surfaces.
&lt;Shape&gt; <br>
&lt;!-- roof --&gt; <pre>
&lt;Appearance&gt; <code class="language-html">
&lt;Material diffuseColor="0.980, 0.502, 0.447"&gt; &lt;/Material&gt; &lt;html&gt;
&lt;/Appearance&gt; &lt;head&gt;
&lt;IndexedFaceSet solid="true" ccw ="true" &lt;title&gt; indexed face set and material &lt;/title&gt;
coordIndex=" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1"&gt; &lt;script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'&gt; &lt;/script&gt;
&lt;Coordinate DEF="pointset" point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1, &lt;link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'&gt;&lt;/link&gt;
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 " &gt; &lt;/head&gt;
&lt;/Coordinate&gt; &lt;body&gt;
&lt;/IndexedFaceSet&gt; &lt;X3D id="shapedata" width="600px" height="600px" style="float:left"&gt;
&lt;/Shape&gt; &lt;Scene&gt;
&lt;Shape&gt; &lt;Shape&gt;
&lt;!-- wall --&gt; &lt;!-- roof --&gt;
&lt;Appearance&gt; &lt;Appearance&gt;
&lt;Material diffuseColor="0.753, 0.753, 0.753"&gt; &lt;/Material&gt; &lt;Material diffuseColor="0.980, 0.502, 0.447"&gt; &lt;/Material&gt;
&lt;/Appearance&gt; &lt;/Appearance&gt;
&lt;IndexedFaceSet solid="true" ccw ="true" &lt;IndexedFaceSet solid="true" ccw ="true"
coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1"&gt; coordIndex=" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1"&gt;
&lt;Coordinate USE="pointset" &gt; &lt;Coordinate DEF="pointset" point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1,
&lt;/Coordinate&gt; -1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 " &gt;
&lt;/IndexedFaceSet&gt; &lt;/Coordinate&gt;
&lt;/Shape&gt; &lt;/IndexedFaceSet&gt;
&lt;Shape&gt; &lt;/Shape&gt;
&lt;!-- ground --&gt; &lt;Shape&gt;
&lt;Appearance&gt; &lt;!-- wall --&gt;
&lt;Material diffuseColor="0.180, 0.280, 0.230"&gt; &lt;/Material&gt; &lt;Appearance&gt;
&lt;/Appearance&gt; &lt;Material diffuseColor="0.753, 0.753, 0.753"&gt; &lt;/Material&gt;
&lt;IndexedFaceSet solid="true" ccw ="true" &lt;/Appearance&gt;
coordIndex=" 0 3 2 1 -1 "&gt; &lt;IndexedFaceSet solid="true" ccw ="true"
&lt;Coordinate USE="pointset" &gt; coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1"&gt;
&lt;/Coordinate&gt; &lt;Coordinate USE="pointset" &gt;
&lt;/IndexedFaceSet&gt; &lt;/Coordinate&gt;
&lt;/Shape&gt; &lt;/IndexedFaceSet&gt;
&lt;/Scene&gt; &lt;/Shape&gt;
&lt;/X3D&gt; &lt;Shape&gt;
</pre> &lt;!-- ground --&gt;
</td> &lt;Appearance&gt;
</tr> &lt;Material diffuseColor="0.180, 0.280, 0.230"&gt; &lt;/Material&gt;
</table> &lt;/Appearance&gt;
<script type="text/javascript" src="x3dom.js"></script> &lt;IndexedFaceSet solid="true" ccw ="true"
</body> coordIndex=" 0 3 2 1 -1 "&gt;
&lt;Coordinate USE="pointset" &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