Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mir
Visualization
Commits
e0789dce
Commit
e0789dce
authored
3 years ago
by
Mandic
Browse files
Options
Download
Email Patches
Plain Diff
Update transform.html
parent
b9fea9e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/X3DOMTutorial/transform.html
+100
-87
public/X3DOMTutorial/transform.html
with
100 additions
and
87 deletions
+100
-87
public/X3DOMTutorial/transform.html
+
100
-
87
View file @
e0789dce
<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>
Transformation
</title>
<title>
Transformation
</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>
Transformation
</h1>
</head>
<table
width=
"100%"
height=
"85%"
border=
"0"
>
<tr>
<body>
<td
width=
"50%"
align=
"center"
valign=
"top"
scope=
"col"
>
<h1>
Transformation
</h1>
<X3D
id=
"shapedata"
width=
"600px"
height=
"600px"
style=
"float:left"
>
<table
width=
"100%"
height=
"85%"
border=
"0"
>
<Scene>
<tr>
<background
transparency=
'0'
skyColor=
'1 1 1'
>
</background>
<td
width=
"50%"
align=
"center"
valign=
"top"
scope=
"col"
>
<Shape>
<X3D
id=
"shapedata"
width=
"600px"
height=
"600px"
style=
"float:left"
>
<Appearance>
<Scene>
<Material
diffuseColor=
'1 0 0'
></Material>
<background
transparency=
'0'
skyColor=
'1 1 1'
>
</background>
</Appearance>
<Shape>
<Box></Box>
<Appearance>
</Shape>
<Material
diffuseColor=
'1 0 0'
></Material>
<Transform
translation=
'-3 0 0'
>
</Appearance>
<Shape>
<Box></Box>
<Appearance>
</Shape>
<Material
diffuseColor=
'0 1 0'
></Material>
<Transform
translation=
'-3 0 0'
>
</Appearance>
<Shape>
<Cone></Cone>
<Appearance>
</Shape>
<Material
diffuseColor=
'0 1 0'
></Material>
</Transform>
</Appearance>
<Transform
translation=
'3 0 0'
>
<Cone></Cone>
<Shape>
</Shape>
<Appearance>
</Transform>
<Material
diffuseColor=
'0 0 1'
></Material>
<Transform
translation=
'3 0 0'
>
</Appearance>
<Shape>
<Sphere></Sphere>
<Appearance>
</Shape>
<Material
diffuseColor=
'0 0 1'
></Material>
</Transform>
</Appearance>
</Scene>
<Sphere></Sphere>
</X3D>
</Shape>
</td>
</Transform>
<td
width=
"50%"
align=
"left"
valign=
"top"
scope=
"col"
>
</Scene>
In X3DOM, a shape such as Box, Cone, and Sphere is always created at the center of the coordinate system. The
</X3D>
size of the shape can be modified,
</p>
but the location is always centered at (0,0,0). To move a shape to another location, a transformation needs to
</td>
be applied. See slides for
<td
width=
"50%"
align=
"left"
valign=
"top"
scope=
"col"
>
the different kinds of affine transformations: translation, rotation, and scaling.
In X3DOM, a shape such as Box, Cone, and Sphere is always created at the center of the coordinate system. The
<br>
size of the shape can be modified,
<pre
class=
"prettyprint"
>
but the location is always centered at (0,0,0). To move a shape to another location, a transformation needs to
<
X3D id="shapedata" width="600px" height="600px" style="float:left"
>
be applied. See slides for
<
Scene
>
the different kinds of affine transformations: translation, rotation, and scaling.
<
background transparency='0' skyColor='1 1 1'
>
<
/background
>
<br>
<
Shape
>
<pre>
<
Appearance
>
<code
class=
"language-html"
>
<
Material diffuseColor='1 0 0'
><
/Material
>
<
html
>
<
/Appearance
>
<
head
>
<
Box
><
/Box
>
<
title
>
Transformation
<
/title
>
<
/Shape
>
<
script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'
>
<
/script
>
<
Transform translation='-3 0 0'
>
<
link rel='stylesheet' type='text/css' href='http://www.x3dom.org/download/x3dom.css'
><
/link
>
<
Shape
>
<
/head
>
<
Appearance
>
<
body
>
<
Material diffuseColor='0 1 0'
><
/Material
>
<
X3D id="shapedata" width="600px" height="600px" style="float:left"
>
<
/Appearance
>
<
Scene
>
<
Cone
><
/Cone
>
<
background transparency='0' skyColor='1 1 1'
>
<
/background
>
<
/Shape
>
<
Shape
>
<
/Transform
>
<
Appearance
>
<
Transform translation='3 0 0'
>
<
Material diffuseColor='1 0 0'
><
/Material
>
<
Shape
>
<
/Appearance
>
<
Appearance
>
<
Box
><
/Box
>
<
Material diffuseColor='0 0 1'
><
/Material
>
<
/Shape
>
<
/Appearance
>
<
Transform translation='-3 0 0'
>
<
Sphere
><
/Sphere
>
<
Shape
>
<
/Shape
>
<
Appearance
>
<
/Transform
>
<
Material diffuseColor='0 1 0'
><
/Material
>
<
/Scene
>
<
/Appearance
>
<
/X3D
>
<
Cone
><
/Cone
>
</pre>
<
/Shape
>
<br>
<
/Transform
>
This example illustrates how to move shapes to another location.
<
Transform translation='3 0 0'
>
</td>
<
Shape
>
</tr>
<
Appearance
>
</table>
<
Material diffuseColor='0 0 1'
><
/Material
>
<script
type=
"text/javascript"
src=
"x3dom.js"
></script>
<
/Appearance
>
</body>
<
Sphere
><
/Sphere
>
<
/Shape
>
</html>
<
/Transform
>
\ No newline at end of file
<
/Scene
>
<
/X3D
>
<
/body
>
<
/html
>
</code>
</pre>
<br>
This example illustrates how to move shapes to another location.
</td>
<script
type=
"text/javascript"
src=
"x3dom.js"
></script>
</body>
</html>
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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