work on getting index translated widget geometry

This commit is contained in:
Stewart Allen 2022-11-01 19:55:30 -04:00
commit 2af361fc5a
8 changed files with 57 additions and 37 deletions

View file

@ -106,8 +106,8 @@ class Stack {
}
}
const { polys, lines, faces, cface, paths, cpath, color, off, norms } = layer;
const { index, opacity } = color;
const { polys, lines, faces, cface, paths, cpath, color, off, norms, rotation } = layer;
const { opacity } = color;
const meshes = [];
const defstate = !off;
const mats = [];
@ -155,7 +155,7 @@ class Stack {
}
geo.setFromPoints(vert);
const segs = new THREE.LineSegments(geo, mat);
if (index) segs.rotation.x = index;
if (rotation) segs.rotation.x = rotation.x;
meshes.push(segs);
group.add(segs);
mats.appendAll(mat);
@ -186,7 +186,7 @@ class Stack {
geo.addGroup(0, Infinity, 0);
}
const mesh = new THREE.Mesh(geo, mat);
if (index) mesh.rotation.x = index;
if (rotation) mesh.rotation.x = rotation.x;
// mesh.castShadow = true;
// mesh.receiveShadow = true;
meshes.push(mesh);
@ -221,7 +221,7 @@ class Stack {
}
const mesh = new THREE.Mesh(geo, mat);
mesh.position.z = z;
if (index) mesh.rotation.x = index;
if (rotation) mesh.rotation.x = rotation.x;
// mesh.castShadow = true;
// mesh.receiveShadow = true;
meshes.push(mesh);