Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mandic
Visualization
Commits
25257593
Commit
25257593
authored
May 01, 2022
by
Mandic
Browse files
Update ifsandmaterial.html
parent
44d6f406
Pipeline
#6370
passed with stages
in 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/X3DOMTutorial/ifsandmaterial.html
View file @
25257593
<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
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/vs.min.css"
>
</head>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"
></script>
<script>
hljs
.
highlightAll
();
</script>
<body>
</head>
<h1>
indexed face set and material
</h1>
<table
width=
"100%"
height=
"85%"
border=
"0"
>
<body>
<tr>
<h1>
indexed face set and material
</h1>
<td
width=
"50%"
align=
"center"
valign=
"top"
scope=
"col"
>
<table
width=
"100%"
height=
"85%"
border=
"0"
>
<X3D
id=
"shapedata"
width=
"600px"
height=
"600px"
style=
"float:left"
>
<tr>
<Scene>
<td
width=
"50%"
align=
"center"
valign=
"top"
scope=
"col"
>
<Shape>
<X3D
id=
"shapedata"
width=
"600px"
height=
"600px"
style=
"float:left"
>
<!-- roof -->
<Scene>
<Appearance>
<Shape>
<Material
diffuseColor=
"0.980, 0.502, 0.447"
>
</Material>
<!-- roof -->
</Appearance>
<Appearance>
<IndexedFaceSet
solid=
"true"
ccw=
"true"
coordIndex=
" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1"
>
<Material
diffuseColor=
"0.980, 0.502, 0.447"
>
</Material>
<Coordinate
DEF=
"pointset"
point=
"-1 0 1, 1 0 1, 1 0 -1, -1 0 -1,
</Appearance>
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 "
>
<IndexedFaceSet
solid=
"true"
ccw=
"true"
coordIndex=
" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1"
>
</Coordinate>
<Coordinate
DEF=
"pointset"
point=
"-1 0 1, 1 0 1, 1 0 -1, -1 0 -1,
</IndexedFaceSet>
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 "
>
</Shape>
</Coordinate>
<Shape>
</IndexedFaceSet>
<!-- wall -->
</Shape>
<Appearance>
<Shape>
<Material
diffuseColor=
"0.753, 0.753, 0.753"
>
</Material>
<!-- wall -->
</Appearance>
<Appearance>
<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"
>
<Material
diffuseColor=
"0.753, 0.753, 0.753"
>
</Material>
<Coordinate
USE=
"pointset"
>
</Appearance>
</Coordinate>
<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"
>
</IndexedFaceSet>
<Coordinate
USE=
"pointset"
>
</Shape>
</Coordinate>
<Shape>
</IndexedFaceSet>
<!-- ground -->
</Shape>
<Appearance>
<Shape>
<Material
diffuseColor=
"0.180, 0.280, 0.230"
>
</Material>
<!-- ground -->
</Appearance>
<Appearance>
<IndexedFaceSet
solid=
"true"
ccw=
"true"
coordIndex=
" 0 3 2 1 -1 "
>
<Material
diffuseColor=
"0.180, 0.280, 0.230"
>
</Material>
<Coordinate
USE=
"pointset"
>
</Appearance>
</Coordinate>
<IndexedFaceSet
solid=
"true"
ccw=
"true"
coordIndex=
" 0 3 2 1 -1 "
>
</IndexedFaceSet>
<Coordinate
USE=
"pointset"
>
</Shape>
</Coordinate>
</Scene>
</IndexedFaceSet>
</X3D>
</Shape>
</td>
</Scene>
<td
width=
"50%"
align=
"left"
valign=
"top"
scope=
"col"
>
</X3D>
One shape has only ony appearance. If different colors for the building elements roof, wall and ground surfaces
</p>
shall be used,
</td>
we need to have different shape for these elements. However, they can share the same point set. The following
<td
width=
"50%"
align=
"left"
valign=
"top"
scope=
"col"
>
example uses different
One shape has only ony appearance. If different colors for the building elements roof, wall and ground surfaces
Material for roo, wall, and ground surfaces.
shall be used,
<br>
we need to have different shape for these elements. However, they can share the same point set. The following
<pre
class=
"prettyprint"
>
example uses different
<
X3D id="shapedata" width="600px" height="600px" style="float:left"
>
Material for roof, wall, and ground surfaces.
<
Scene
>
<br>
<
Shape
>
<pre>
<
!-- roof --
>
<code
class=
"language-html"
>
<
Appearance
>
<
html
>
<
Material diffuseColor="0.980, 0.502, 0.447"
>
<
/Material
>
<
head
>
<
/Appearance
>
<
title
>
indexed face set and material
<
/title
>
<
IndexedFaceSet solid="true" ccw ="true"
<
script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'
>
<
/script
>
coordIndex=" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1"
>
<
link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'
><
/link
>
<
Coordinate DEF="pointset" point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1,
<
/head
>
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 "
>
<
body
>
<
/Coordinate
>
<
X3D id="shapedata" width="600px" height="600px" style="float:left"
>
<
/IndexedFaceSet
>
<
Scene
>
<
/Shape
>
<
Shape
>
<
Shape
>
<
!-- roof --
>
<
!-- wall --
>
<
Appearance
>
<
Appearance
>
<
Material diffuseColor="0.980, 0.502, 0.447"
>
<
/Material
>
<
Material diffuseColor="0.753, 0.753, 0.753"
>
<
/Material
>
<
/Appearance
>
<
/Appearance
>
<
IndexedFaceSet solid="true" ccw ="true"
<
IndexedFaceSet solid="true" ccw ="true"
coordIndex=" 7 4 8 -1 4 5 8 -1 5 6 8 -1 6 7 8 -1"
>
coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1"
>
<
Coordinate DEF="pointset" point="-1 0 1, 1 0 1, 1 0 -1, -1 0 -1,
<
Coordinate USE="pointset"
>
-1 2 1, 1 2 1, 1 2 -1, -1 2 -1, 0 3 0 "
>
<
/Coordinate
>
<
/Coordinate
>
<
/IndexedFaceSet
>
<
/IndexedFaceSet
>
<
/Shape
>
<
/Shape
>
<
Shape
>
<
Shape
>
<
!-- ground --
>
<
!-- wall --
>
<
Appearance
>
<
Appearance
>
<
Material diffuseColor="0.180, 0.280, 0.230"
>
<
/Material
>
<
Material diffuseColor="0.753, 0.753, 0.753"
>
<
/Material
>
<
/Appearance
>
<
/Appearance
>
<
IndexedFaceSet solid="true" ccw ="true"
<
IndexedFaceSet solid="true" ccw ="true"
coordIndex=" 0 3 2 1 -1 "
>
coordIndex=" 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 3 0 4 7 -1"
>
<
Coordinate USE="pointset"
>
<
Coordinate USE="pointset"
>
<
/Coordinate
>
<
/Coordinate
>
<
/IndexedFaceSet
>
<
/IndexedFaceSet
>
<
/Shape
>
<
/Shape
>
<
/Scene
>
<
Shape
>
<
/X3D
>
<
!-- ground --
>
</pre>
<
Appearance
>
</td>
<
Material diffuseColor="0.180, 0.280, 0.230"
>
<
/Material
>
</tr>
<
/Appearance
>
</table>
<
IndexedFaceSet solid="true" ccw ="true"
<script
type=
"text/javascript"
src=
"x3dom.js"
></script>
coordIndex=" 0 3 2 1 -1 "
>
</body>
<
Coordinate USE="pointset"
>
<
/Coordinate
>
</html>
<
/IndexedFaceSet
>
\ No newline at end of file
<
/Shape
>
<
/Scene
>
<
/X3D
>
<
/body
>
<
/html
>
</code>
</pre>
</td>
<script
type=
"text/javascript"
src=
"x3dom.js"
></script>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment