Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commita45f695ebd7b64dfe5cdb911c51d65a5c8eb2cbe (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-10-24 20:21:03 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-10-24 20:21:03 +0300
Files0dbc3751b87719463edefeac111247a28238e4b5
uni-projects-a45f695ebd7b64dfe5cdb911c51d65a5c8eb2cbe.tar
uni-projects-a45f695ebd7b64dfe5cdb911c51d65a5c8eb2cbe.tar.gz
uni-projects-a45f695ebd7b64dfe5cdb911c51d65a5c8eb2cbe.zip
Parent2fb13b2c94e73ae8a4112df8ad98d092906e76ba (diff)
[OKG/HW03] Finished homework
1 files changed, 17 insertions, 13 deletions
-rw-r--r--Year 2/Computer Graphics Fundamentals/Practicum Homework/a03.html30
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 );
}
// КРАЙ