const canvasSpace = 200;\r
\r
/** Constant Frame Time */\r
- const frameTime = 1000.0 / 60.0;\r
+ const frameTime = 1000.0 / 200.0;\r
\r
/** Setup scene */\r
let [scene, camera, renderer] = setup_scene(canvasSpace);\r
//const loader = new THREE.TextureLoader();\r
//Red color: 0xC70039\r
\r
- const cloth = new Cloth(1, 0.5, 20, 10);\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
* @param {number} dt - time passed since last frame in ms\r
*/\r
function animate(dt) {\r
- // simulate cloth\r
+ cloth.simulate(dt / 1000);\r
+\r
+ cloth.updateGeometry(clothGeometry);\r
\r
raycaster.setFromCamera( new THREE.Vector2((mousePos.x / w) * 2 - 1, ((h - mousePos.y) / h) * 2 - 1), camera );\r
\r