]> gitweb.ps.run Git - cloth_sim/blobdiff - Scripts/main.js
add cloth-cloth collision
[cloth_sim] / Scripts / main.js
index 7611601767f080739052a9eba4a97ccd09f6d75c..6fa9f22f226dd1d8b5b46e2678df0eb03e3ad74b 100644 (file)
@@ -83,13 +83,17 @@ function init() {
   //const loader = new THREE.TextureLoader();\r
   //Red color: 0xC70039\r
 \r
-  const cloth = new Cloth(1, 0.5, 40, 20);\r
+  const cloth = new Cloth(1, 0.5, 20, 20);\r
   const clothGeometry = cloth.generateGeometry();\r
   //const clothMaterial = new THREE.MeshStandardMaterial({ map: loader.load('Textures/DeutschlandFlagge.jpg'), color: 0xffffff, side: THREE.DoubleSide, flatShading: false});\r
   const clothMaterial = new THREE.MeshStandardMaterial({ color: 0xC70039, side: THREE.DoubleSide, flatShading: false });\r
   const clothMesh = new THREE.Mesh(clothGeometry, clothMaterial);\r
   scene.add(clothMesh);\r
   \r
+  document.getElementById("windToggle").onchange = (e) => {\r
+    options.wind = e.target.checked;\r
+  };\r
+\r
   let raycaster = new THREE.Raycaster();\r
   let intersects;\r
   let rightMousePressed;\r