Commit f031586a authored by Ayivor's avatar Ayivor
Browse files

Update Cube.html

parent 2a8585cd
Pipeline #8235 passed with stage
in 6 seconds
...@@ -24,7 +24,8 @@ async function activateXR() { ...@@ -24,7 +24,8 @@ async function activateXR() {
const scene = new THREE.Scene(); const scene = new THREE.Scene();
// The cube will have a different color on each side. // The cube will have a different color on each side.
const materials = [ const cubeGeometry = new THREE.BoxBufferGeometry(0.5, 0.5, 0.5);
const cubeMaterials = [
new THREE.MeshBasicMaterial({color: 0x003366}), new THREE.MeshBasicMaterial({color: 0x003366}),
new THREE.MeshBasicMaterial({color: 0x66ccff}), new THREE.MeshBasicMaterial({color: 0x66ccff}),
new THREE.MeshBasicMaterial({color: 0xff6666}), new THREE.MeshBasicMaterial({color: 0xff6666}),
...@@ -34,7 +35,7 @@ const materials = [ ...@@ -34,7 +35,7 @@ const materials = [
]; ];
// 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 cube = new THREE.Mesh(cubeGeometry, cubeMaterials);
cube.position.set(0, 0, -1); cube.position.set(0, 0, -1);
scene.add(cube); scene.add(cube);
......
Supports Markdown
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