abouttreesummaryrefslogcommitdiff
path: root/Scripts/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/main.js')
-rw-r--r--Scripts/main.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/Scripts/main.js b/Scripts/main.js
index 20a6e92..4c57ff9 100644
--- a/Scripts/main.js
+++ b/Scripts/main.js
@@ -52,11 +52,11 @@ function init() {
/** setup cloth and generate debug mesh */
let cloth = new Cloth();
- cloth.createBasic(10, 10, 10, 10);
+ cloth.createBasic(10, 10, 50, 50);
//cloth.createDebugMesh(scene);
//const material = new THREE.MeshBasicMaterial({ color: 0x0000ff, side: THREE.DoubleSide });
- const material = new THREE.MeshPhongMaterial({ color: 0x0000ff, side: THREE.DoubleSide });
+ const material = new THREE.MeshStandardMaterial({ color: 0x0000ff, side: THREE.DoubleSide, flatShading: false });
const mesh = new THREE.Mesh(cloth.geometry, material);
//const mesh = new THREE.WireframeGeometry(cloth.geometry);
//const line = new THREE.LineSegments(mesh);
@@ -65,11 +65,17 @@ function init() {
//line.material.transparent = true;
scene.add(mesh);
- scene.add( new THREE.AmbientLight( 0x666666 ) );
-
- const light = new THREE.DirectionalLight( 0xffffff, 0.5 );
- light.position.set( 0, 1, 0.5 );
- scene.add( light );
+ scene.add( new THREE.AmbientLight( 0x222222 ) );
+
+ const light1 = new THREE.PointLight( 0xffffff, 1, 100 );
+ light1.position.set( 2, 1, 80 );
+ scene.add( light1 );
+ const light2 = new THREE.PointLight( 0xffffff, 1, 100 );
+ light2.position.set( -2, 1, 80 );
+ scene.add( light2 );
+ const light3 = new THREE.PointLight( 0xffffff, 1, 100 );
+ light3.position.set( 0, -1, 80 );
+ scene.add( light3 );
let raycaster = new THREE.Raycaster();