From 43f4d7a1cc2bcf42d10b800f5f7ae591731328a5 Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Sat, 22 Jul 2023 14:56:43 +1000 Subject: [PATCH] We have octahedron --- main.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 675b629..54e58ac 100644 --- a/main.js +++ b/main.js @@ -11,11 +11,12 @@ function makeLink(link_m, n1, n2) { const geometry = new THREE.CylinderGeometry(LINK_SIZE, LINK_SIZE,length); // const geometry = new THREE.SphereGeometry(LINK_SIZE); const cyl = new THREE.Mesh(geometry, link_m); - cyl.position.x = centre.x; - cyl.position.y = centre.y; - cyl.position.z = centre.z; - cyl.lookAt(n2); - return cyl; + const pivot = new THREE.Group(); + pivot.add(cyl); + pivot.position.copy(centre); + pivot.lookAt(n2); + cyl.rotation.x = Math.PI / 2.0; + return pivot; }