Commit c80299e4 authored by Rafiei's avatar Rafiei
Browse files

Update index.html

parent 018b413d
Pipeline #9666 passed with stage
in 6 seconds
...@@ -38,6 +38,19 @@ const cube = new THREE.Mesh(new THREE.BoxBufferGeometry(0.5, 0.5, 0.5), material ...@@ -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); cube.position.set(0, 0, -1);
scene.add(cube); 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. // Set up the WebGLRenderer, which handles rendering to the session's base layer.
const renderer = new THREE.WebGLRenderer({ const renderer = new THREE.WebGLRenderer({
alpha: true, alpha: true,
...@@ -92,6 +105,8 @@ const onXRFrame = (time, frame) => { ...@@ -92,6 +105,8 @@ const onXRFrame = (time, frame) => {
} }
session.requestAnimationFrame(onXRFrame); session.requestAnimationFrame(onXRFrame);
} }
</script> </script>
</body> </body>
......
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