From a45f695ebd7b64dfe5cdb911c51d65a5c8eb2cbe Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 24 Oct 2022 20:21:03 +0300 Subject: [OKG/HW03] Finished homework --- .../Practicum Homework/a03.html | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Year 2/Computer Graphics Fundamentals/Practicum Homework/a03.html b/Year 2/Computer Graphics Fundamentals/Practicum Homework/a03.html index 8b26132..a78535c 100644 --- a/Year 2/Computer Graphics Fundamentals/Practicum Homework/a03.html +++ b/Year 2/Computer Graphics Fundamentals/Practicum Homework/a03.html @@ -18,14 +18,14 @@ var aspect = window.innerWidth/window.innerHeight; var camera = new THREE.PerspectiveCamera( 30, aspect ); - camera.position.set( 1, 8, 3 ); + camera.position.set( 2, 7, 3 ); camera.lookAt( new THREE.Vector3() ); // КРАЙ var ring = new THREE.Group(); - var loopMaterial = new THREE.MeshPhongMaterial(); + var loopMaterial = new THREE.MeshPhongMaterial({ color: 'gold' }); var ornamentMaterial = new THREE.MeshPhongMaterial({ color: 'orange' }) // Loop @@ -34,25 +34,29 @@ ring.add(new THREE.Mesh(new THREE.TorusGeometry(ringRadius, ringWidth, 16, 100), loopMaterial)); // Big gem - var big = new THREE.Mesh(new THREE.SphereGeometry(0.3, 32, 16), ornamentMaterial); - big.position.set(-0.2, ringRadius + ringWidth, 0); + var big = new THREE.Mesh(new THREE.SphereGeometry(0.26, 32, 16), ornamentMaterial); + big.position.set(0, ringRadius + ringWidth, -0.1); ring.add(big); // Small gems - var small1 = new THREE.Mesh(new THREE.SphereGeometry(0.1, 32, 16), ornamentMaterial); - small1.position.set(0.19, ringRadius + ringWidth, 0); - ring.add(small1); + var gemGeometry = new THREE.SphereGeometry(0.1, 32, 16); - var small2 = new THREE.Mesh(new THREE.SphereGeometry(0.1, 32, 16), ornamentMaterial); - small1.position.set(0.19, ringRadius + ringWidth, 0); + var small1 = new THREE.Mesh(gemGeometry, ornamentMaterial); + small1.position.set(0, ringRadius + ringWidth, 0.24); ring.add(small1); - var small2 = new THREE.Mesh(new THREE.SphereGeometry(0.1, 32, 16), ornamentMaterial); - small1.position.set(0.19, ringRadius + ringWidth, 0); - ring.add(small1); + var small2 = new THREE.Mesh(gemGeometry, ornamentMaterial); + small2.position.set(0.19, ringRadius + ringWidth, 0.14); + ring.add(small2); + + var small3 = new THREE.Mesh(gemGeometry, ornamentMaterial); + small3.position.set(-0.19, ringRadius + ringWidth, 0.14); + ring.add(small3); scene.add(ring); + + // От тука до "КРАЙ" е откраднато от задача 1 на практикум 2 var light = new THREE.PointLight( ); light.position.set( 3, 4, 5 ); @@ -65,7 +69,7 @@ // въртене на сцената като в микровълнова фурна function drawFrame() { - scene.rotation.y += 0.005; + scene.rotation.y += 0.04; renderer.render( scene, camera ); } // КРАЙ -- cgit v1.3.1-23-gd82d