abouttreesummaryrefslogcommitdiff
path: root/Scripts/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/main.js')
-rw-r--r--Scripts/main.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/Scripts/main.js b/Scripts/main.js
index 8c61f82..4e7c2ef 100644
--- a/Scripts/main.js
+++ b/Scripts/main.js
@@ -84,7 +84,8 @@ function init() {
cloth.createBasic(10, 10, 10, 10);
//cloth.createDebugMesh(scene);
- const material = new THREE.MeshBasicMaterial({ color: 0x0000ff });
+ //const material = new THREE.MeshBasicMaterial({ color: 0x0000ff, side: THREE.DoubleSide });
+ const material = new THREE.MeshPhongMaterial({ color: 0x0000ff, side: THREE.DoubleSide });
const mesh = new THREE.Mesh(cloth.geometry, material);
//const mesh = new THREE.WireframeGeometry(cloth.geometry);
//const line = new THREE.LineSegments(mesh);
@@ -93,6 +94,12 @@ 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 );
+
/**
* function called every frame
* @param {number} dt - time passed since last frame in ms