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.
28 lines
981 B
28 lines
981 B
4 years ago
|
/**
|
||
|
* Implentation of the saturn.
|
||
|
* Texture from https://www.solarsystemscope.com/textures/1
|
||
|
*/
|
||
|
|
||
|
import * as THREE from '/website/node_modules/three/build/three.module.js';
|
||
|
|
||
|
|
||
|
const saturnRingTexture = new THREE.TextureLoader().load('/website/saturn/saturnring.jpg');
|
||
|
const saturnRing = new THREE.TorusGeometry(12, 1, 16, 60);
|
||
|
const materialRing = new THREE.MeshStandardMaterial({ map: saturnRingTexture });
|
||
|
export const saturn = new THREE.Mesh( saturnRing, materialRing );
|
||
|
|
||
|
// Den Saturnplaneten hinzufuegen
|
||
|
const saturnTexture = new THREE.TextureLoader().load('/website/saturn/saturn.jpg');
|
||
|
const saturnPlanet = new THREE.SphereGeometry( 10, 32, 16 );
|
||
|
const materialSaturn = new THREE.MeshStandardMaterial( { map: saturnTexture } );
|
||
|
const saturnSphere = new THREE.Mesh( saturnPlanet, materialSaturn );
|
||
|
saturn.add(saturnSphere)
|
||
|
|
||
|
saturn.position.x = 210;
|
||
|
|
||
|
export function rotation(){
|
||
|
saturn.rotation.x -= 0.01;
|
||
|
saturn.rotation.y -= 0.01;
|
||
|
saturn.rotation.z -= 0.01;
|
||
|
}
|