Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Thapa
visualization
Commits
5a5d4887
Commit
5a5d4887
authored
Jun 19, 2023
by
Thapa
Browse files
Update index.html
parent
f7ad868c
Pipeline
#7875
passed with stage
in 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
5a5d4887
...
...
@@ -4,7 +4,7 @@
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<title>
Cub
e Demo
</title>
<title>
spher
e Demo
</title>
<!-- three.js -->
<script
src=
"https://unpkg.com/three@0.126.0/build/three.js"
></script>
...
...
@@ -13,7 +13,7 @@
<!-- Starting an immersive WebXR session requires user interaction.
We start this one with a simple button. -->
<button
onclick=
"activateXR()"
>
Start
Cub
e Demo
</button>
<button
onclick=
"activateXR()"
>
Start
spher
e Demo
</button>
<script>
async
function
activateXR
()
{
// Add a canvas element and initialize a WebGL context that is compatible with WebXR.
...
...
@@ -23,20 +23,15 @@ async function activateXR() {
const
scene
=
new
THREE
.
Scene
();
// The
cub
e will have a different color on each side.
// The
spher
e will have a different color on each side.
const
materials
=
[
new
THREE
.
MeshPhongMaterial
({
color
:
0x000000
}),
new
THREE
.
MeshPhongMaterial
({
color
:
0x0000ff
}),
new
THREE
.
MeshPhongMaterial
({
color
:
0x00ff00
}),
new
THREE
.
MeshPhongMaterial
({
color
:
0xff00ff
}),
new
THREE
.
MeshPhongMaterial
({
color
:
0xffffff
}),
new
THREE
.
MeshPhongMaterial
({
color
:
0xffff00
})
new
THREE
.
MeshPhongMaterial
({
color
:
#
9
ecae1
})
];
// Create the
cub
e and add it to the demo scene.
const
cub
e
=
new
THREE
.
Mesh
(
new
THREE
.
BoxBuff
erGeometry
(
0.2
,
0.2
,
0.2
),
materials
);
cub
e
.
position
.
set
(
1
,
1
,
1
);
scene
.
add
(
cub
e
);
// Create the
spher
e and add it to the demo scene.
const
spher
e
=
new
THREE
.
Mesh
(
new
THREE
.
Sph
er
e
Geometry
(
0.2
,
0.2
,
0.2
),
materials
);
spher
e
.
position
.
set
(
1
,
1
,
1
);
scene
.
add
(
spher
e
);
// Set up the WebGLRenderer, which handles rendering to the session's base layer.
...
...
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