abouttreesummaryrefslogcommitdiff
path: root/Scripts/main.js
diff options
context:
space:
mode:
authorPatrick Schönberger2021-02-06 13:57:27 +0100
committerPatrick Schönberger2021-02-06 13:57:27 +0100
commit8bf51c36d322cb8d4f099d3475563ee4e520ab92 (patch)
tree99faede5a34fb4b8309b44c90301fd2fcc944f95 /Scripts/main.js
parent8199b09231f15b0f84480656a0e92827d795fcdc (diff)
downloadcloth_sim-8bf51c36d322cb8d4f099d3475563ee4e520ab92.tar.gz
cloth_sim-8bf51c36d322cb8d4f099d3475563ee4e520ab92.zip
uv mapping, add texture to flag
Diffstat (limited to 'Scripts/main.js')
-rw-r--r--Scripts/main.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/Scripts/main.js b/Scripts/main.js
index 6fa9f22..5e68a4f 100644
--- a/Scripts/main.js
+++ b/Scripts/main.js
@@ -1,5 +1,4 @@
-//import { } from './cloth.js';
-//import { OrbitControls } from './OrbitControls.js';
+
function addLights(scene){
scene.add( new THREE.AmbientLight( 0x222222 ) );
@@ -80,16 +79,17 @@ function init() {
/** Setup scene */
let [scene, camera, renderer] = setup_scene(canvasSpace);
- //const loader = new THREE.TextureLoader();
+ const loader = new THREE.TextureLoader();
//Red color: 0xC70039
const cloth = new Cloth(1, 0.5, 20, 20);
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 clothMaterial = new THREE.MeshStandardMaterial({ map: loader.load('Textures/hsrm.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);
+ document.getElementById("windToggle").checked = options.wind;
document.getElementById("windToggle").onchange = (e) => {
options.wind = e.target.checked;
};