From 20e8d90ec3270ba2a4dc98a4cba078cdffb5689d Mon Sep 17 00:00:00 2001 From: TreetopFlyer Date: Sun, 11 Jul 2021 16:44:34 -0400 Subject: [PATCH] add light to show back --- index.html | 7 ++++--- region.js | 42 ------------------------------------------ 2 files changed, 4 insertions(+), 45 deletions(-) diff --git a/index.html b/index.html index ea11c07..28a637c 100644 --- a/index.html +++ b/index.html @@ -34,17 +34,18 @@ let surfaceTest = () => let surfaceGeometry = new THREE.BufferGeometry(); surfaceGeometry.setAttribute('position', new THREE.BufferAttribute(surface.vert, 3) ); surfaceGeometry.setIndex(surface.triPointVert); - surfaceGeometry.computeVertexNormals(); + surfaceGeometry.computeVertexNormals(true); let surfaceObject = new THREE.Mesh( surfaceGeometry, - new THREE.MeshBasicMaterial({color:0xaa9900, wireframe:true}) + new THREE.MeshPhongMaterial({color:0xaa9900, side:THREE.DoubleSide, shading:THREE.FlatShading}) ); return { DOM:"canvas", Init(inScene) - { + { + inScene.add(new THREE.PointLight(0xffffff, 1, 100)) inScene.add(surfaceObject); inScene.add(new THREE.GridHelper(10, 10)); }, diff --git a/region.js b/region.js index 3bd8a0c..9a4f739 100644 --- a/region.js +++ b/region.js @@ -1,47 +1,5 @@ -export const Kernel = -{ - Corners: - [ - [ 1, 1, -1], - [ 1, -1, -1], - [-1, 1, -1], - [-1, -1, -1], - [ 1, 1, 1], - [ 1, -1, 1], - [-1, 1, 1], - [-1, -1, 1] - ], - Cardinal: - [ - [ 1, 0, 0], - [ 0, 1, 0], - [-1, 0, 0], - [ 0, -1, 0], - [ 0, 0, 1], - [ 0, 0, -1] - ], - Loop(inList, inVector, inHandler) - { - for(let i=0; i