This is a scale model of the solar system I made in DB. You'll have to make the media yourself.
set display mode 800,600,32 : hide mouse : sync on : set camera range 10,11000000
`set window on
`set window title "Solar System Demo"
firstZoom = 1
`PLANET INFORMATION
`Distances
mercury_dist# = 580 * 100
venus_dist# = 1080 * 100
earth_dist# = 1500 * 100
mars_dist# = 2280 * 100
jupiter_dist# = 7780 * 100
saturn_dist# = 14270 * 100
uranus_dist# = 28710 * 100
neptune_dist# = 44970 * 100
pluto_dist# = 59130 * 100
`Revolution
mercury_rev# = 87.66
venus_rev# = 228.28125
earth_rev# = 365.25
mars_rev# = 693.975
jupiter_rev# = 4383
saturn_rev# = 10592.25
uranus_rev# = 30681
neptune_rev# = 60266.25
pluto_rev# = 90582
`Size
sun_size# = 14 * 100
mercury_size# = 0.04878 * 100
venus_size# = 0.12104 * 100
earth_size# = 0.12756 * 100
mars_size# = 0.06794 * 100
jupiter_size# = 1.428 * 100
saturn_size# = 1.2054 * 100
uranus_size# = 0.512 * 100
neptune_size# = 0.495 * 100
pluto_size# = 0.022 * 100
`System
cfocus = 2
accel# = 0.1
pvis = 1
xtra = 0
pcycletimer = 0
pstatnum = 0
planet_ang# = 0
`LOAD IMAGES
`Planets
sun_img = 1 : load image "sun.jpg",1
mercury_img = 2 : load image "mercury.jpg",2
venus_img = 3 : load image "venus.jpg",3
earth_img = 4 : load image "earth.jpg",4
mars_img = 5 : load image "mars.jpg",5
jupiter_img = 6 : load image "jupiter.jpg",6
saturn_img = 7 : load image "saturn.jpg",7
uranus_img = 8 : load image "uranus.jpg",8
neptune_img = 9 : load image "neptune.jpg",9
pluto_img = 10 : load image "pluto.jpg",10
`Stars
bg_img = 11 : load image "space.jpg",11
`Orbit
orbit_img = 12 : load image "orbit.bmp",12
`CREATE OBJECTS
`Set Backdrop
backdrop on : texture backdrop 11
`Planets
sun_obj = 1 : make object sphere 1,sun_size# : texture object 1,1
sunshell_obj = 12 : make object sphere 12,sun_size# + 1000 : texture object 12,1 : ghost object on 12
mercury_obj = 2 : make object sphere 2,mercury_size# : texture object 2,2
venus_obj = 3 : make object sphere 3,venus_size# : texture object 3,3
earth_obj = 4 : make object sphere 4,earth_size# : texture object 4,4
mars_obj = 5 : make object sphere 5,mars_size# : texture object 5,5
jupiter_obj = 6 : make object sphere 6,jupiter_size# : texture object 6,6
saturn_obj = 7 : make object sphere 7,saturn_size# : texture object 7,7
uranus_obj = 8 : make object sphere 8,uranus_size# : texture object 8,8
neptune_obj = 9 : make object sphere 9,neptune_size# : texture object 9,9
pluto_obj = 10 : make object sphere 10,pluto_size# : texture object 10,10
`Orbits
mercury_orb_obj = 13 : make object plain 13,mercury_dist#*2,mercury_dist#*2 : set object 13,1,0,1 : texture object 13,12
venus_orb_obj = 14 : make object plain 14,venus_dist#*2,venus_dist#*2 : set object 14,1,0,1 : texture object 14,12
earth_orb_obj = 15 : make object plain 15,earth_dist#*2,earth_dist#*2 : set object 15,1,0,1 : texture object 15,12
mars_orb_obj = 16 : make object plain 16,mars_dist#*2,mars_dist#*2 : set object 16,1,0,1 : texture object 16,12
jupiter_orb_obj = 17 : make object plain 17,jupiter_dist#*2,jupiter_dist#*2 : set object 17,1,0,1 : texture object 17,12
saturn_orb_obj = 18 : make object plain 18,saturn_dist#*2,saturn_dist#*2 : set object 18,1,0,1 : texture object 18,12
uranus_orb_obj = 19 : make object plain 19,uranus_dist#*2,uranus_dist#*2 : set object 19,1,0,1 : texture object 19,12
neptune_orb_obj = 20 : make object plain 20,neptune_dist#*2,neptune_dist#*2 : set object 20,1,0,1 : texture object 20,12
pluto_orb_obj = 21 : make object plain 21,pluto_dist#*2,pluto_dist#*2 : set object 21,1,0,1 : texture object 21,12
for i = 13 to 21
ghost object on i
fade object i,65
xrotate object i,90
fix object pivot i
next i
`SET LIGHTS
set ambient light 0
make light 1
color light 1,255,255,230
set light range 1,20000000 * 1000000000
position light 1,object position x(sun_obj),object position y(sun_obj),object position z(sun_obj)
`----------------------------------------------
`MAIN LOOP
do
`Print Information
set cursor 0,0
ink rgb(192,192,192),rgb(0,0,0)
print screen fps();" FPS"
if cammode = 1 : print "Camera is in 'follow' mode" : else : print "Camera is in 'free' mode" : endif
print "Press space to toggle camera mode, use keys 1-9 to select planet in follow mode"
print "Press enter to show/hide orbit paths"
print "Press the left arrow/right arrow to zoom in/out ";
ink rgb(140,140,140),rgb(0,0,0)
print "(Planet's size is larger than normal in zoom mode)"
print "Press CTRL to show extra information"
if xtra = 1
ink RGB(0,128,255),rgb(0,0,0)
set cursor 0,600 - (text height("a") * 9)
print "Mercury Angle = ";int(wrapvalue(mercury_ang#));"; X = ";int(mercury_x#);"; Z = ";int(mercury_z#)
print "Venus Angle = ";int(wrapvalue(venus_ang#));"; X = ";int(venus_x#);"; Z = ";int(venus_z#)
print "Earth Angle = ";int(wrapvalue(earth_ang#));"; X = ";int(earth_x#);"; Z = ";int(earth_z#)
print "Mars Angle = ";int(wrapvalue(mars_ang#));"; X = ";int(mars_x#);"; Z = ";int(mars_z#)
print "Jupiter Angle = ";int(wrapvalue(jupiter_ang#));"; X = ";int(jupiter_x#);"; Z = ";int(jupiter_z#)
print "Saturn Angle = ";int(wrapvalue(saturn_ang#));"; X = ";int(saturn_x#);"; Z = ";int(saturn_z#)
print "Uranus Angle = ";int(wrapvalue(uranus_ang#));"; X = ";int(uranus_x#);"; Z = ";int(uranus_z#)
print "Neptune Angle = ";int(wrapvalue(neptune_ang#));"; X = ";int(neptune_x#);"; Z = ";int(neptune_z#)
print "Pluto Angle = ";int(wrapvalue(pluto_ang#));"; X = ";int(pluto_x#);"; Z = ";int(pluto_z#)
if pcycletimer = timer()
if pstatnum < 9
inc pstatnum
pcycletimer = timer() + 2000
else
pstatnum = 1
pcycletimer = timer() + 2000
endif
endif
`Mercury
if pstatnum = 1
if (0.24 * earth_rev#) = mercury_rev#
stat$ = "Mercury's orbit is correct."
else
stat$ = "Mercury's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - mercury_rev#)))+"."
endif
endif
`Venus
if pstatnum = 2
if (0.625 * earth_rev#) = venus_rev#
stat$ = "Venus's orbit is correct."
else
stat$ = "Venus's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - venus_rev#)))+"."
endif
endif
`Earth
if pstatnum = 3
if (1 * earth_rev#) = Earth_rev#
stat$ = "Earth's orbit is correct."
else
stat$ = "Earth's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - Earth_rev#)))+"."
endif
endif
`Mars
if pstatnum = 4
if (1.9 * earth_rev#) = Mars_rev#
stat$ = "Mars's orbit is correct."
else
stat$ = "Mars's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - Mars_rev#)))+"."
endif
endif
`Jupiter
if pstatnum = 5
if (12 * earth_rev#) = Jupiter_rev#
stat$ = "Jupiter's orbit is correct."
else
stat$ = "Jupiter's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - Jupiter_rev#)))+"."
endif
endif
`Saturn
if pstatnum = 6
if (29 * earth_rev#) = Saturn_rev#
stat$ = "Saturn's orbit is correct."
else
stat$ = "Saturn's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - Saturn_rev#)))+"."
endif
endif
`Uranus
if pstatnum = 7
if (84 * earth_rev#) = Uranus_rev#
stat$ = "Uranus's orbit is correct."
else
stat$ = "Uranus's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - Uranus_rev#)))+"."
endif
endif
`Neptune
if pstatnum = 8
if (165 * earth_rev#) = Neptune_rev#
stat$ = "Neptune's orbit is correct."
else
stat$ = "Neptune's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - Neptune_rev#)))+"."
endif
endif
`Pluto
if pstatnum = 9
if (248 * earth_rev#) = Pluto_rev#
stat$ = "Pluto's orbit is correct."
else
stat$ = "Pluto's orbit is off by "+str$(int(abs((0.24 * earth_rev#) - Pluto_rev#)))+"."
endif
endif
set cursor 800 - text width(stat$),0
print stat$
endif
if controlkey() = 1
if xtra = 0
xtra = 1
pcycletimer = timer() + 500
else
if xtra = 1
xtra = 0
endif
endif
endif
ink rgb(255,255,255),rgb(0,0,0)
`Rotate Backdrop
scroll backdrop camera angle y(),camera angle x()
`Rotate the Sun's outer shell
yrotate object sunshell_obj,wrapvalue(object angle y(sunshell_obj)+3)
`Zoom
if rightkey() = 1 and zoom = 1
firstZoom = 0
zoom = 0
scale object cfocus,100,100,100
set object cfocus,1,1,1,1,1
endif
if leftkey() = 1 and zoom = 0
if firstZoom = 1 then zoomTipTimer = timer() + 5000
zoom = 1
sf# = (1000 / object size(cfocus)) + 500
scale object cfocus,sf#,sf#,sf#
set object cfocus,1,1,1,1,0
endif
if zoom = 1
ink RGB(255,128,255),0
if zoomTipTimer > timer()
text 2,object screen y(cfocus)+30,"Tip: When you are zoomed in, the planets' names appear in pink."
endif
endif
`Mercury
mercury_ang# = (mercury_ang# + (360 / mercury_rev#))
mercury_x# = cos(mercury_ang#) * mercury_dist#
mercury_z# = sin(mercury_ang#) * mercury_dist#
position object mercury_obj,mercury_x#,0,mercury_z#
set cursor object screen x(mercury_obj)-20,object screen y(mercury_obj)-20
print "[mercury]"
`venus
venus_ang# = (venus_ang# + (360 / venus_rev#))
venus_x# = cos(venus_ang#) * venus_dist#
venus_z# = sin(venus_ang#) * venus_dist#
position object venus_obj,venus_x#,0,venus_z#
set cursor object screen x(venus_obj)-20,object screen y(venus_obj)-20
print "[venus]"
`earth
earth_ang# = (earth_ang# + (360 / earth_rev#))
earth_x# = cos(earth_ang#) * earth_dist#
earth_z# = sin(earth_ang#) * earth_dist#
position object earth_obj,earth_x#,0,earth_z#
set cursor object screen x(earth_obj)-20,object screen y(earth_obj)-20
print "[earth]"
`mars
mars_ang# = (mars_ang# + (360 / mars_rev#))
mars_x# = cos(mars_ang#) * mars_dist#
mars_z# = sin(mars_ang#) * mars_dist#
position object mars_obj,mars_x#,0,mars_z#
set cursor object screen x(mars_obj)-20,object screen y(mars_obj)-20
print "[mars]"
`jupiter
jupiter_ang# = (jupiter_ang# + (360 / jupiter_rev#))
jupiter_x# = cos(jupiter_ang#) * jupiter_dist#
jupiter_z# = sin(jupiter_ang#) * jupiter_dist#
position object jupiter_obj,jupiter_x#,0,jupiter_z#
set cursor object screen x(jupiter_obj)-20,object screen y(jupiter_obj)-20
print "[jupiter]"
`saturn
saturn_ang# = (saturn_ang# + (360 / saturn_rev#))
saturn_x# = cos(saturn_ang#) * saturn_dist#
saturn_z# = sin(saturn_ang#) * saturn_dist#
position object saturn_obj,saturn_x#,0,saturn_z#
set cursor object screen x(saturn_obj)-20,object screen y(saturn_obj)-20
print "[saturn]"
`uranus
uranus_ang# = (uranus_ang# + (360 / uranus_rev#))
uranus_x# = cos(uranus_ang#) * uranus_dist#
uranus_z# = sin(uranus_ang#) * uranus_dist#
position object uranus_obj,uranus_x#,0,uranus_z#
set cursor object screen x(uranus_obj)-20,object screen y(uranus_obj)-20
print "[uranus]"
`neptune
neptune_ang# = (neptune_ang# + (360 / neptune_rev#))
neptune_x# = cos(neptune_ang#) * neptune_dist#
neptune_z# = sin(neptune_ang#) * neptune_dist#
position object neptune_obj,neptune_x#,0,neptune_z#
set cursor object screen x(neptune_obj)-20,object screen y(neptune_obj)-20
print "[neptune]"
`pluto
pluto_ang# = (pluto_ang# + (360 / pluto_rev#))
pluto_x# = cos(pluto_ang#) * pluto_dist#
pluto_z# = sin(pluto_ang#) * pluto_dist#
position object pluto_obj,pluto_x#,0,pluto_z#
set cursor object screen x(pluto_obj)-20,object screen y(pluto_obj)-20
print "[pluto]"
`Orbit Paths
if returnkey() = 1
if pvis = 1
pvis = 0
sleep 20
else
if pvis = 0
pvis = 1
sleep 20
endif
endif
endif
if pvis = 0
for i = 13 to 21
if object visible(i) = 1 then hide object i
next i
else
if pvis = 1
for i = 13 to 21
if object visible(i) = 0 then show object i
next i
endif
endif
`Camera
if cammode = 1
if inkey$() = "1" then cfocus = 2
if inkey$() = "2" then cfocus = 3
if inkey$() = "3" then cfocus = 4
if inkey$() = "4" then cfocus = 5
if inkey$() = "5" then cfocus = 6
if inkey$() = "6" then cfocus = 7
if inkey$() = "7" then cfocus = 8
if inkey$() = "8" then cfocus = 9
if inkey$() = "9" then cfocus = 10
endif
if cammode = 0
cx# = wrapvalue(cx# + mousemovey())
cy# = wrapvalue(cy# + mousemovex())
cz# = wrapvalue(cz# + mousemovez())
rotate camera cx#,cy#,cz#
if upkey() = 1
accel# = accel# + 100
move camera accel#
else
if downkey() = 1
accel# = accel# + 100
move camera accel# * -1
else
accel# = 0
endif
endif
endif
if cammode = 1
cfx# = object position x(cfocus)
cfy# = object position y(cfocus)
cfz# = object position z(cfocus)
set camera to follow cfx#,cfy#,cfz#,90,10,100,2,0
`set camera to follow cfx#,cfy#,cfz#,90,15,1000,5,0
point camera cfx#,cfy#,cfz#
endif
if spacekey() = 1
if cammode = 1
cammode = 0
sleep 20
else
cammode = 1
sleep 20
endif
endif
sync
loop
`----------------------------------------------
function openBox(x1,y1,x2,y2)
line x1,y1,x1,y2
line x1,y1,x2,y1
line x2,y1,x2,y2
line x1,y2,x2,y2
endfunction