Update index.html
Browse files12345678910111213141516171819<!DOCTYPE html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869<!DOCTYPE html><html><head><meta charset="utf-8"><title>Iceland Landscape</title><style>body {margin: 0;overflow: hidden;}canvas {width: 100%;height: 100%;}</style></head><body><canvas id="myCanvas"></canvas><script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script><script>// Load Iceland topography datavar loader = new THREE.TerrainLoader();loader.load('iceland-heightmap.png', function(terrainData) {// Initialize the scene, camera, and renderervar scene = new THREE.Scene();var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);var renderer = new THREE.WebGLRenderer({ antialias: true });renderer.setSize(window.innerWidth, window.innerHeight);document.body.appendChild(renderer.domElement);// Create landscape meshvar geometry = new THREE.PlaneGeometry(100, 100, terrainData.width - 1, terrainData.height - 1);geometry.rotateX(-Math.PI / 2);for (var i = 0, l = geometry.vertices.length; i < l; i++) {geometry.vertices[i].z = terrainData.heightmap[i] / 100;}var material = new THREE.MeshStandardMaterial({color: 0xaaaaaa,metalness: 0.1,roughness: 0.7});var landscape = new THREE.Mesh(geometry, material);scene.add(landscape);// Add point light to scenevar light = new THREE.PointLight(0xffffff, 1, 100);light.position.set(0, 10, 0);scene.add(light);// Set camera positioncamera.position.set(0, 10, 20);// Add orbit controls for cameravar controls = new THREE.OrbitControls(camera, renderer.domElement);controls.target.set(0, 10, 0);controls.update();// Render the scenefunction animate() {requestAnimationFrame(animate);renderer.render(scene, camera);}animate();});</script></body></html>
index.html+67-17