]> gitweb.ps.run Git - cloth_sim/blobdiff - Scripts/main.js
render cloth
[cloth_sim] / Scripts / main.js
index 4d873377ca96cc4f6c5609b54bb723330d2553ff..d54aa9fc258ddc5e670268f519d3cfcb70eefe7c 100644 (file)
@@ -79,8 +79,16 @@ function init() {
 \r
   /** Setup scene */\r
   let [scene, camera, renderer] = setup_scene(canvasSpace);\r
-\r
-  // Add Cloth Initialization\r
+  \r
+  //const loader = new THREE.TextureLoader();\r
+  //Red color: 0xC70039\r
+\r
+  const cloth = new Cloth(1, 0.5, 20, 10);\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
   let raycaster = new THREE.Raycaster();\r
   let intersects;\r