python just for fun
-
I have no idea where i should post this, so whatever. here is a python program i made using vpython. I it must be downloaded before the program works. Also the program is made in python 3.1. It is a (very) innaccurate simulation of the milkyway.....mostly just created for the hell of it.
from visual import *
milkyway = frame()
sun_frame = frame(frame = milkyway)
mercury_frame= frame(frame = milkyway)
venus_frame= frame(frame = milkyway)
earth_frame= frame(frame = milkyway)
mars_frame= frame(frame = milkyway)
jupiter_frame= frame(frame = milkyway)
saturn_frame= frame(frame = milkyway)
uranus_frame= frame(frame = milkyway)
neptune_frame= frame(frame = milkyway)
pluto_frame= frame(frame = milkyway)sun = sphere(frame = sun_frame, pos = (0, 0, 0), radius = 10, color = color.yellow, material = materials.emissive)
mercury = sphere(frame = mercury_frame, pos = (15, 0, 0), radius = 0.5, color = color.red, material = materials.rough)
venus = sphere(frame = venus_frame, pos = (25, 0, 0), radius = 1, color = color.orange, material = materials.emissive)
earth = sphere(frame = earth_frame, pos = (33, 0, 0), radius = 2, material = materials.earth)
mars = sphere(frame = mars_frame, pos = (39, 0, 0), color = color.red, material = materials.rough)
jupiter = sphere(frame = jupiter_frame, pos = (50, 0, 0), radius = 3, color = color.orange, material = materials.emissive)
saturn = sphere(frame = saturn_frame, pos = (60, 0, 0), radius = 2.5, color = color.magenta, material = materials.rough)
saturns_rings = ring(frame = saturn.frame, pos = saturn.pos, axis = (-1, 1, 0), radius = 4)
uranus = sphere(frame = uranus_frame, pos = (75, 0, 0), radius = 2.15, color = color.cyan, material = materials.emissive)
neptune = sphere(frame = neptune_frame, pos = (83, 0, 0), radius = 1.75, color = color.blue, material = materials.rough)
pluto = sphere(frame = pluto_frame, pos = (90, 0, 0), color = color.blue, material = materials.emissive)view = input('Would you like a <S>ide-view or a <O>verhead view?\n')
if view == 'o' or view == 'O':
milkyway.rotate(angle = pi/4)
else:
passdef revolve_venus(venus):
venus.frame.rotate(angle = pi/6, axis = (0, 1, 0), origin = sun.pos)def revolve_mercury(mercury):
mercury.frame.rotate(angle = pi/5, axis = (0, 1, 0), origin = sun.pos)def revolve_earth(earth):
earth.frame.rotate(angle = pi/7, axis = (0, 1, 0), origin = sun.pos)def revolve_mars(mars):
mars.frame.rotate(angle = pi/8, axis = (0, 1, 0), origi -
I have no idea where i should post this, so whatever. here is a python program i made using vpython. I it must be downloaded before the program works. Also the program is made in python 3.1. It is a (very) innaccurate simulation of the milkyway.....mostly just created for the hell of it.
from visual import *
milkyway = frame()
sun_frame = frame(frame = milkyway)
mercury_frame= frame(frame = milkyway)
venus_frame= frame(frame = milkyway)
earth_frame= frame(frame = milkyway)
mars_frame= frame(frame = milkyway)
jupiter_frame= frame(frame = milkyway)
saturn_frame= frame(frame = milkyway)
uranus_frame= frame(frame = milkyway)
neptune_frame= frame(frame = milkyway)
pluto_frame= frame(frame = milkyway)sun = sphere(frame = sun_frame, pos = (0, 0, 0), radius = 10, color = color.yellow, material = materials.emissive)
mercury = sphere(frame = mercury_frame, pos = (15, 0, 0), radius = 0.5, color = color.red, material = materials.rough)
venus = sphere(frame = venus_frame, pos = (25, 0, 0), radius = 1, color = color.orange, material = materials.emissive)
earth = sphere(frame = earth_frame, pos = (33, 0, 0), radius = 2, material = materials.earth)
mars = sphere(frame = mars_frame, pos = (39, 0, 0), color = color.red, material = materials.rough)
jupiter = sphere(frame = jupiter_frame, pos = (50, 0, 0), radius = 3, color = color.orange, material = materials.emissive)
saturn = sphere(frame = saturn_frame, pos = (60, 0, 0), radius = 2.5, color = color.magenta, material = materials.rough)
saturns_rings = ring(frame = saturn.frame, pos = saturn.pos, axis = (-1, 1, 0), radius = 4)
uranus = sphere(frame = uranus_frame, pos = (75, 0, 0), radius = 2.15, color = color.cyan, material = materials.emissive)
neptune = sphere(frame = neptune_frame, pos = (83, 0, 0), radius = 1.75, color = color.blue, material = materials.rough)
pluto = sphere(frame = pluto_frame, pos = (90, 0, 0), color = color.blue, material = materials.emissive)view = input('Would you like a <S>ide-view or a <O>verhead view?\n')
if view == 'o' or view == 'O':
milkyway.rotate(angle = pi/4)
else:
passdef revolve_venus(venus):
venus.frame.rotate(angle = pi/6, axis = (0, 1, 0), origin = sun.pos)def revolve_mercury(mercury):
mercury.frame.rotate(angle = pi/5, axis = (0, 1, 0), origin = sun.pos)def revolve_earth(earth):
earth.frame.rotate(angle = pi/7, axis = (0, 1, 0), origin = sun.pos)def revolve_mars(mars):
mars.frame.rotate(angle = pi/8, axis = (0, 1, 0), origi -
I have no idea where i should post this, so whatever. here is a python program i made using vpython. I it must be downloaded before the program works. Also the program is made in python 3.1. It is a (very) innaccurate simulation of the milkyway.....mostly just created for the hell of it.
from visual import *
milkyway = frame()
sun_frame = frame(frame = milkyway)
mercury_frame= frame(frame = milkyway)
venus_frame= frame(frame = milkyway)
earth_frame= frame(frame = milkyway)
mars_frame= frame(frame = milkyway)
jupiter_frame= frame(frame = milkyway)
saturn_frame= frame(frame = milkyway)
uranus_frame= frame(frame = milkyway)
neptune_frame= frame(frame = milkyway)
pluto_frame= frame(frame = milkyway)sun = sphere(frame = sun_frame, pos = (0, 0, 0), radius = 10, color = color.yellow, material = materials.emissive)
mercury = sphere(frame = mercury_frame, pos = (15, 0, 0), radius = 0.5, color = color.red, material = materials.rough)
venus = sphere(frame = venus_frame, pos = (25, 0, 0), radius = 1, color = color.orange, material = materials.emissive)
earth = sphere(frame = earth_frame, pos = (33, 0, 0), radius = 2, material = materials.earth)
mars = sphere(frame = mars_frame, pos = (39, 0, 0), color = color.red, material = materials.rough)
jupiter = sphere(frame = jupiter_frame, pos = (50, 0, 0), radius = 3, color = color.orange, material = materials.emissive)
saturn = sphere(frame = saturn_frame, pos = (60, 0, 0), radius = 2.5, color = color.magenta, material = materials.rough)
saturns_rings = ring(frame = saturn.frame, pos = saturn.pos, axis = (-1, 1, 0), radius = 4)
uranus = sphere(frame = uranus_frame, pos = (75, 0, 0), radius = 2.15, color = color.cyan, material = materials.emissive)
neptune = sphere(frame = neptune_frame, pos = (83, 0, 0), radius = 1.75, color = color.blue, material = materials.rough)
pluto = sphere(frame = pluto_frame, pos = (90, 0, 0), color = color.blue, material = materials.emissive)view = input('Would you like a <S>ide-view or a <O>verhead view?\n')
if view == 'o' or view == 'O':
milkyway.rotate(angle = pi/4)
else:
passdef revolve_venus(venus):
venus.frame.rotate(angle = pi/6, axis = (0, 1, 0), origin = sun.pos)def revolve_mercury(mercury):
mercury.frame.rotate(angle = pi/5, axis = (0, 1, 0), origin = sun.pos)def revolve_earth(earth):
earth.frame.rotate(angle = pi/7, axis = (0, 1, 0), origin = sun.pos)def revolve_mars(mars):
mars.frame.rotate(angle = pi/8, axis = (0, 1, 0), origiThere is also a flaw in your description: this is a simulation of the solar system, not the Milky Way. The latter would require a few stars in addition to the sun.
-
There is also a flaw in your description: this is a simulation of the solar system, not the Milky Way. The latter would require a few stars in addition to the sun.
-
....ok....i guess this does make sense (except for pluto not being a planet.) I'll have to be a bit more careful next time. ;)
-
-
Like 4 years ago, in 2006 Internation Astronimocal Union changed or rather, refined the definition of planet and pluto was too small to be fitting into that. So they reclassified it as dwarf planet.
-
I have no idea where i should post this, so whatever. here is a python program i made using vpython. I it must be downloaded before the program works. Also the program is made in python 3.1. It is a (very) innaccurate simulation of the milkyway.....mostly just created for the hell of it.
from visual import *
milkyway = frame()
sun_frame = frame(frame = milkyway)
mercury_frame= frame(frame = milkyway)
venus_frame= frame(frame = milkyway)
earth_frame= frame(frame = milkyway)
mars_frame= frame(frame = milkyway)
jupiter_frame= frame(frame = milkyway)
saturn_frame= frame(frame = milkyway)
uranus_frame= frame(frame = milkyway)
neptune_frame= frame(frame = milkyway)
pluto_frame= frame(frame = milkyway)sun = sphere(frame = sun_frame, pos = (0, 0, 0), radius = 10, color = color.yellow, material = materials.emissive)
mercury = sphere(frame = mercury_frame, pos = (15, 0, 0), radius = 0.5, color = color.red, material = materials.rough)
venus = sphere(frame = venus_frame, pos = (25, 0, 0), radius = 1, color = color.orange, material = materials.emissive)
earth = sphere(frame = earth_frame, pos = (33, 0, 0), radius = 2, material = materials.earth)
mars = sphere(frame = mars_frame, pos = (39, 0, 0), color = color.red, material = materials.rough)
jupiter = sphere(frame = jupiter_frame, pos = (50, 0, 0), radius = 3, color = color.orange, material = materials.emissive)
saturn = sphere(frame = saturn_frame, pos = (60, 0, 0), radius = 2.5, color = color.magenta, material = materials.rough)
saturns_rings = ring(frame = saturn.frame, pos = saturn.pos, axis = (-1, 1, 0), radius = 4)
uranus = sphere(frame = uranus_frame, pos = (75, 0, 0), radius = 2.15, color = color.cyan, material = materials.emissive)
neptune = sphere(frame = neptune_frame, pos = (83, 0, 0), radius = 1.75, color = color.blue, material = materials.rough)
pluto = sphere(frame = pluto_frame, pos = (90, 0, 0), color = color.blue, material = materials.emissive)view = input('Would you like a <S>ide-view or a <O>verhead view?\n')
if view == 'o' or view == 'O':
milkyway.rotate(angle = pi/4)
else:
passdef revolve_venus(venus):
venus.frame.rotate(angle = pi/6, axis = (0, 1, 0), origin = sun.pos)def revolve_mercury(mercury):
mercury.frame.rotate(angle = pi/5, axis = (0, 1, 0), origin = sun.pos)def revolve_earth(earth):
earth.frame.rotate(angle = pi/7, axis = (0, 1, 0), origin = sun.pos)def revolve_mars(mars):
mars.frame.rotate(angle = pi/8, axis = (0, 1, 0), origiBetter remove question icon from your post and add some text in title specifying that this is not a question, since this forum is generally used to ask and answer programming questions.