abouttreesummaryrefslogcommitdiff
path: root/Scripts/main.js
diff options
context:
space:
mode:
authorPatrick Schönberger2021-02-06 11:25:43 +0100
committerPatrick Schönberger2021-02-06 11:25:43 +0100
commit323d38f395da1cae25ba629d3365c37c30f53fdf (patch)
treef24e04652c1749decfcd117d3b129b4c805f524b /Scripts/main.js
parent8a3364b0cd057fcfb7f89da112b9032fee76e403 (diff)
downloadcloth_sim-323d38f395da1cae25ba629d3365c37c30f53fdf.tar.gz
cloth_sim-323d38f395da1cae25ba629d3365c37c30f53fdf.zip
render cloth
Diffstat (limited to 'Scripts/main.js')
-rw-r--r--Scripts/main.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/Scripts/main.js b/Scripts/main.js
index 4d87337..d54aa9f 100644
--- a/Scripts/main.js
+++ b/Scripts/main.js
@@ -79,8 +79,16 @@ function init() {
/** Setup scene */
let [scene, camera, renderer] = setup_scene(canvasSpace);
-
- // Add Cloth Initialization
+
+ //const loader = new THREE.TextureLoader();
+ //Red color: 0xC70039
+
+ const cloth = new Cloth(1, 0.5, 20, 10);
+ const clothGeometry = cloth.generateGeometry();
+ //const clothMaterial = new THREE.MeshStandardMaterial({ map: loader.load('Textures/DeutschlandFlagge.jpg'), color: 0xffffff, side: THREE.DoubleSide, flatShading: false});
+ const clothMaterial = new THREE.MeshStandardMaterial({ color: 0xC70039, side: THREE.DoubleSide, flatShading: false });
+ const clothMesh = new THREE.Mesh(clothGeometry, clothMaterial);
+ scene.add(clothMesh);
let raycaster = new THREE.Raycaster();
let intersects;