Commit 86ad8f5d authored by Rafiei's avatar Rafiei
Browse files

Update index.html

parent c80299e4
Pipeline #9667 passed with stage
in 6 seconds
...@@ -23,19 +23,24 @@ async function activateXR() { ...@@ -23,19 +23,24 @@ async function activateXR() {
const scene = new THREE.Scene(); const scene = new THREE.Scene();
// The cube will have a different color on each side.
const materials = [
new THREE.MeshBasicMaterial({color: 0xff0000}), // Enable shadows in the renderer.
new THREE.MeshBasicMaterial({color: 0x0000ff}), renderer.shadowMap.enabled = true;
new THREE.MeshBasicMaterial({color: 0x00ff00}),
new THREE.MeshBasicMaterial({color: 0xff00ff}),
new THREE.MeshBasicMaterial({color: 0x00ffff}),
new THREE.MeshBasicMaterial({color: 0xffff00})
];
// Create the cube and add it to the demo scene. // Create the cube and add it to the demo scene.
const cube = new THREE.Mesh(new THREE.BoxBufferGeometry(0.5, 0.5, 0.5), materials); const cubeGeometry = new THREE.BoxBufferGeometry(0.5, 0.5, 0.5);
const cubeMaterials = [
new THREE.MeshLambertMaterial({ color: 0xff0000 }), // Red
new THREE.MeshLambertMaterial({ color: 0x0000ff }), // Blue
new THREE.MeshLambertMaterial({ color: 0x00ff00 }), // Green
new THREE.MeshLambertMaterial({ color: 0xff00ff }), // Magenta
new THREE.MeshLambertMaterial({ color: 0x00ffff }), // Cyan
new THREE.MeshLambertMaterial({ color: 0xffff00 }) // Yellow
];
const cube = new THREE.Mesh(cubeGeometry, cubeMaterials);
cube.position.set(0, 0, -1); cube.position.set(0, 0, -1);
cube.castShadow = true; // Enable shadow casting
scene.add(cube); scene.add(cube);
......
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