fix invert bug

master
howard 2021-04-26 02:33:28 -07:00
parent 31e0893a56
commit 5bde0fb599
2 changed files with 10 additions and 8 deletions

View File

@ -129,11 +129,11 @@ export default class Scene {
const dist = 500
const light1 = new THREE.PointLight(color.lighting, 0.7);
light1.position.set(dist, dist, dist);
helpersGroup.add(light1);
const light2 = new THREE.PointLight(color.lighting, 0.7);
light2.position.set(-dist, -dist, -dist);
const light1 = new THREE.PointLight(color.lighting, 0.5);
light1.position.set(dist * 1, dist * 2, dist * 3);
helpersGroup.add(light1)
const light2 = new THREE.PointLight(color.lighting, 0.5);
light2.position.set(-dist * 1, -dist * 2, -dist * 3);
helpersGroup.add(light2);
@ -237,6 +237,7 @@ export default class Scene {
entries[k] = loader.parse(state.byId[k])
if (entries[k].userData.inverted) {
flipBufferGeometryNormals(entries[k].geometry)
}
@ -324,7 +325,6 @@ export default class Scene {
let curId
let que = [id]
let idx = 0
// let newNodes = {}
while (idx < que.length) {
curId = que[idx++]
@ -339,7 +339,7 @@ export default class Scene {
}
byId[curId].geometry.copy(newNode.geometry)
byId[curId].geometry.parameters = newNode.geometry.parameters // took 2 hours to figure out
byId[curId].userData.inverted = newNode.userData.inverted
}
for (let k in tree[curId]) {

View File

@ -107,6 +107,8 @@ export function extrude(sketch, depth) {
if (depth < 0) {
flipBufferGeometryNormals(mesh.geometry)
mesh.userData.inverted = true
// console.log('heere')
console.log('heere', mesh)
}
return mesh