- /** setup cloth and generate debug mesh */\r
- let cloth = new Cloth();\r
- cloth.createBasic(1, 0.5, 20, 20);\r
- document.getElementById("windToggle").onchange = (e) => {\r
- if (e.target.checked)\r
- cloth.windFactor.set(0.5, 0.2, 0.2);\r
- else\r
- cloth.windFactor.set(0, 0, 0);\r
- };\r
- //cloth.createDebugMesh(scene);\r
-\r
-\r
- const material = new THREE.MeshStandardMaterial({ color: 0xC70039, side: THREE.DoubleSide, flatShading: false });\r
- const mesh = new THREE.Mesh(cloth.geometry, material);\r
-\r
- scene.add(mesh);\r
-\r
-\r
+ //const loader = new THREE.TextureLoader();\r
+ //Red color: 0xC70039\r
+\r
+ const cloth = new Cloth(1, 0.5, 40, 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