Dies ist das Repository meines kleinen Portfolios.
Im Hintergrund läuft eine Planetensimulation, geschrieben in JavaScript und Three.js.
Die zu sehenden Texturen stammen von:
https://www.solarsystemscope.com/textures/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
692 B
25 lines
692 B
/** |
|
* Implentation of the earth. |
|
* Texture from https://upload.wikimedia.org/wikipedia/commons/d/d6/Nasa_land_ocean_ice_8192.jpg |
|
*/ |
|
|
|
import * as THREE from '/website/node_modules/three/build/three.module.js'; |
|
|
|
|
|
|
|
const earthTexture = new THREE.TextureLoader().load('/website/earth/earth.jpg'); |
|
const earthSphere = new THREE.SphereGeometry(10, 32, 16); |
|
const material = new THREE.MeshStandardMaterial({ map: earthTexture }); |
|
export const earth = new THREE.Mesh( earthSphere, material ); |
|
export const pivot = new THREE.Object3D(); |
|
|
|
earth.add(pivot); |
|
|
|
earth.position.x = 100; |
|
|
|
var forward = true; |
|
|
|
export function rotation(){ |
|
earth.rotation.y += 0.01; |
|
pivot.rotation.x -= 0.025; |
|
}
|
|
|