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.
29 lines
770 B
29 lines
770 B
4 years ago
|
/**
|
||
|
* 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 pi = 3;
|
||
|
|
||
|
const earthTexture = new THREE.TextureLoader().load('/website/earth/earth.jpg');
|
||
|
const earthSphere = new THREE.SphereGeometry(7, 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 = -60;
|
||
|
|
||
|
var forward = true;
|
||
|
|
||
|
export function rotation(){
|
||
|
earth.rotation.y += 0.01;
|
||
|
pivot.rotation.x += 0.01;
|
||
|
//pivot.rotation.y += 0.005;
|
||
|
//pivot.rotation.z += 0.01;
|
||
|
}
|