From 23baf4200e7ec9ff38128bdf9c4f4b2bc285c655 Mon Sep 17 00:00:00 2001 From: Icybear Date: Sat, 27 Jul 2024 17:22:45 -0400 Subject: [PATCH] added Thinker model to website. Not sure how to resize or position. --- .../{Lowest_poly_thinker.stl => thinker.stl} | Bin index.html | 2 ++ main.js | 29 +++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) rename assets/models/{Lowest_poly_thinker.stl => thinker.stl} (100%) diff --git a/assets/models/Lowest_poly_thinker.stl b/assets/models/thinker.stl similarity index 100% rename from assets/models/Lowest_poly_thinker.stl rename to assets/models/thinker.stl diff --git a/index.html b/index.html index 6b770dc..1509581 100644 --- a/index.html +++ b/index.html @@ -108,6 +108,8 @@ Marbel texture image by kues1 on Freepik
"The Thinker" 3d model by LxO +
+ "Galaxy background from " rawpixel.com

diff --git a/main.js b/main.js index d6dfafc..b531c04 100644 --- a/main.js +++ b/main.js @@ -38,7 +38,34 @@ renderer.render(scene, camera); -//stl loader code to import stl 3d model +//stl code to import stl 3d model +const thinkerMaterial = new THREE.MeshPhysicalMaterial({ + color: 'FFFFFF', + metalness: 0.50, + roughness: 0.1, + opacity: 1.0, + transparent: false, + transmission: 0.99, + clearcoat: 1.0, + clearcoatRoughness: 0.25, + +}) + +const thinkerLoader = new STLLoader(); + +thinkerLoader.load( + 'assets/models/thinker.stl', + function (geometry) { + const thinkerMesh = new THREE.Mesh(geometry, thinkerMaterial) + scene.add(thinkerMesh) + }, + (xhr) => { + console.log((xhr.loaded / xhr.total) * 100 + '% loaded') + }, + (error) => { + console.log(error) + } +) const ambientLight = new THREE.AmbientLight(0xffffff);