Rotating Earth orbiting the Sun
This is a simple Earth and Sun model. This model is not to scale in terms of size and distance.
The rotation and revolution speeds are roughly to scale. The Earth in this model is rotating at 1 second per rotation. It is also revolving at 365 seconds per revolution.
The Earth has a tile of 23.5 degrees on its rotation axis to the orbiting plane. There are also some background stars (points). This model can be easily created using VRMath2 Editor.
Below I will explain how I created this model. You may want to take this as a challenge to create your own after reading. Or, as usual, I have attached the Logo file at the end of this blog for you to try.
; Project: Rotating Earth ; This is an early demonstration of animation in VRMath2 ; THe whole animation framework is still under construction and planning ; CS RESET SETBG 31 ; set black background ; here we collect orientation for earth's rotation TR 23.5 ; tiltright 23.5 degrees MAKE "orilist ORI ; create a variable :orilist to collect orientation MAKE "orikey [0] ; create a variable :orikey to collect time fractions for animation ; now while doing repeat, collect the turtle's roientation after each lt 90 (left turn 90 degrees) ; lput will add its first input into the second input. REPEAT 4 [LT 90 MAKE "orilist LPUT ORI :orilist MAKE "orikey LPUT REPCOUNT/4 :orikey] HOME ; bring the turtle upright WEST 5 ; move the turtle to west 5 so it can start drawing the orbiting circle ; below we draw the orbit circle and collect the revolving position at the same time MAKE "poslist POS MAKE "poskey [0] SETPCNAME "white PD REPEAT 30 [FD 1 RT 12 MAKE "poslist LPUT POS :poslist MAKE "poskey LPUT REPCOUNT/30 :poskey] PU SETMAT 0 34 BALL ; this is the Earth MAKE "earth OBJECT SELECT OBJECT SETIMAGETEXTURE 8 8 ; apply Earth's texture ; below is for the imaginery Earth's axis SETSCALE .05 2 .05 SETDC 880 150 10 SETEC 0 0 0 SETSC 190 30 30 SETAI 83.3 SETSH 80 SETTR 0 CYLINDER ; this is the axis in red ; preparing for anoimation MAKE "axis OBJECT TIMESENSOR "time1 1 "true ORIINT "rota :orikey :orilist ROUTE "rt1 "time1 "fraction_changed "rota "set_fraction ROUTE "rt2 "rota "value_changed :earth "rotation ROUTE "rt3 "rota "value_changed :axis "rotation TIMESENSOR "time2 365.25 "true POSINT "posi :poskey :poslist ROUTE "rt4 "time2 "fraction_changed "posi "set_fraction ROUTE "rt5 "posi "value_changed :earth "translation ROUTE "rt6 "posi "value_changed :axis "translation ; create some random stars at the background POINT ; change turtle track to point mode PD REPEAT 100 [ SETPC (RANDOM 200)+800 (RANDOM 200)+800 (RANDOM 200)+800 SETXYZ (RANDOM 300)-150 (RANDOM 300)-150 (RANDOM 300)-150 ] PU HOME DESELECT ; remember to deselect or material settings will apply to the object next ; below is for the Sun SETSCALE 1.2 1.2 1.2 SETDC 1000 900 610 SETEC 1000 800 500 SETSC 1000 900 0 SETAI 0 SETSH 0 SETTR 0 BALL
Pleasse give me a comment of what you think.
- Andy's blog
- Login or register to post comments
- 32512 reads
Comments
Curious
I am massively curious as to how you got the earth to rotate! looks awesome.