@ -26,9 +26,15 @@ const renderer = new THREE.WebGLRenderer({
renderer . setPixelRatio ( window . devicePixelRatio ) ;
renderer . setSize ( window . innerWidth , window . innerHeight ) ;
camera . position . setZ ( 30 ) ;
camera . position . setX ( - 200 ) ;
camera . position . setY ( 30 ) ;
var cameraX = 200 ;
var cameraY = 100 ;
var cameraZ = 100 ;
camera . position . setZ ( cameraZ ) ;
camera . position . setX ( cameraX ) ;
camera . position . setY ( cameraY ) ;
// Die Sonne
const sunTexture = new THREE . TextureLoader ( ) . load ( 'sun.jpg' )
@ -45,6 +51,7 @@ const pivotMARS = new THREE.Object3D();
const pivotJUPITER = new THREE . Object3D ( ) ;
const pivotSATURN = new THREE . Object3D ( ) ;
const pivotURANUS = new THREE . Object3D ( ) ;
const pivotCamera = new THREE . Object3D ( ) ;
scene . add ( pivotEARTH ) ;
scene . add ( pivotVENUS ) ;
@ -53,6 +60,7 @@ scene.add(pivotMARS);
scene . add ( pivotJUPITER ) ;
scene . add ( pivotSATURN ) ;
scene . add ( pivotURANUS ) ;
scene . add ( pivotCamera ) ;
pivotEARTH . add ( EARTH . earth ) ;
pivotVENUS . add ( VENUS . venus ) ;
@ -61,9 +69,10 @@ pivotMARS.add(MARS.mars);
pivotJUPITER . add ( JUPITER . jupiter ) ;
pivotSATURN . add ( SATURN . saturn ) ;
pivotURANUS . add ( URANUS . uranus ) ;
pivotURANUS . add ( camera ) ;
// Der Mond dreht sich sich um die erde.
// Den Mond hinzufügen
EARTH . pivot . add ( MOON . moon ) ;
scene . add ( sun ) ;
@ -104,10 +113,6 @@ scene.add(pointLight);
//scene.add(gridHelper);
scene . add ( ambientLight ) ;
//Planeten hinzufuegen
//scene.add(EARTH.earth)
//scene.add(MOON.moon)
renderer . render ( scene , camera ) ;
@ -118,8 +123,6 @@ function animate() {
requestAnimationFrame ( animate ) ;
sun . rotation . x += 0.001 ;
//sun.rotation.y += 0.005;
//sun.rotation.z += 0.001;
EARTH . rotation ( ) ;
MERKUR . rotation ( ) ;
VENUS . rotation ( ) ;
@ -131,15 +134,18 @@ function animate() {
pivotEARTH . rotation . y += 0.005 ;
pivotMERKUR . rotation . y -= 0.005 ;
pivotVENUS . rotation . x += 0.005 ;
pivotVENUS . rotation . y += 0.005 ;
pivotVENUS . rotation . z += 0.005 ;
pivotMARS . rotation . x -= 0.005 ;
pivotMARS . rotation . y -= 0.005 ;
pivotMARS . rotation . z -= 0.005 ;
pivotJUPITER . rotation . z += 0.005 ;
pivotSATURN . rotation . z -= 0.005 ;
pivotURANUS . rotation . x += 0.005 ;
pivotSATURN . rotation . y -= 0.005 ;
pivotURANUS . rotation . y += 0.005 ;
cameraX += 0.000001 ;
cameraZ += 0.000001 ;
camera . position . setZ ( cameraZ ) ;
camera . position . setX ( cameraX ) ;
camera . position . setY ( cameraY ) ;
controls . update ( ) ;
renderer . render ( scene , camera ) ;