Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Rafiei
Ar_test
Commits
c80299e4
Commit
c80299e4
authored
Jun 17, 2024
by
Rafiei
Browse files
Update index.html
parent
018b413d
Pipeline
#9666
passed with stage
in 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
c80299e4
...
...
@@ -38,6 +38,19 @@ const cube = new THREE.Mesh(new THREE.BoxBufferGeometry(0.5, 0.5, 0.5), material
cube
.
position
.
set
(
0
,
0
,
-
1
);
scene
.
add
(
cube
);
// Create a sphere geometry.
const
sphereGeometry
=
new
THREE
.
SphereBufferGeometry
(
0.3
,
32
,
32
);
// Adjust the radius and other parameters as needed.
// Create a material for the sphere (you can customize the color).
const
sphereMaterial
=
new
THREE
.
MeshBasicMaterial
({
color
:
0xffff00
});
// Create the sphere and add it to the scene.
const
sphere
=
new
THREE
.
Mesh
(
sphereGeometry
,
sphereMaterial
);
sphere
.
position
.
set
(
1
,
0
,
-
1
);
// Position the sphere next to the cube.
scene
.
add
(
sphere
);
// Set up the WebGLRenderer, which handles rendering to the session's base layer.
const
renderer
=
new
THREE
.
WebGLRenderer
({
alpha
:
true
,
...
...
@@ -92,6 +105,8 @@ const onXRFrame = (time, frame) => {
}
session
.
requestAnimationFrame
(
onXRFrame
);
}
</script>
</body>
...
...
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