From 5a5d488776aea2992e9b8916f53d39f35d56dd4b Mon Sep 17 00:00:00 2001 From: Thapa <luxthapa6363@gmail.com> Date: Mon, 19 Jun 2023 12:22:54 +0000 Subject: [PATCH] Update index.html --- public/index.html | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/public/index.html b/public/index.html index a5b0fd7..cfdc2d5 100644 --- a/public/index.html +++ b/public/index.html @@ -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>Cube Demo</title> + <title>sphere 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 Cube Demo</button> +<button onclick="activateXR()">Start sphere 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 cube will have a different color on each side. +// The sphere 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: #9ecae1}) ]; -// Create the cube and add it to the demo scene. -const cube = new THREE.Mesh(new THREE.BoxBufferGeometry(0.2, 0.2, 0.2), materials); -cube.position.set(1, 1, 1); -scene.add(cube); +// Create the sphere and add it to the demo scene. +const sphere = new THREE.Mesh(new THREE.SphereGeometry(0.2, 0.2, 0.2), materials); +sphere.position.set(1, 1, 1); +scene.add(sphere); // Set up the WebGLRenderer, which handles rendering to the session's base layer. -- GitLab