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:
pass
def 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), origin = sun.pos)
def revolve_jupiter(jupiter):
jupiter.frame.rotate(angle = pi/10, axis = (0, 1, 0), origin = sun.pos)
def revolve_saturn(saturn):
saturn.frame.rotate(angle = pi/12, axis = (0, 1, 0), origin = sun.pos)
def revolve_pluto(pluto):
pluto.frame.rotate(angle = pi/20, axis = (0, 1, 0), origin = sun.pos)
def revolve_neptune(neptune):
neptune.frame.axis.rotate(angle = pi/16, axis = (0, 1, 0), origin = sun.pos)
def revolve_uranus(uranus):
uranus.frame.rotate(angle = pi/14, axis = (0, 1 , 0), origin = sun.pos)
def revolve_neptune(neptune):
neptune.frame.rotate(angle = pi/16, axis = (0, 1, 0), origin = sun.pos)
def revolve_all_planets(mercury, venus, earth, mars, jupiter, saturn, uranus, neptune, pluto):
while True:
revolve_mercury(mercury)
revolve_venus(venus)
revolve_earth(earth)
revolve_mars(mars)
revolve_jupiter(jupiter)
revolve_saturn(saturn)
revolve_uranus(uranus)
revolve_neptune(neptune)
revolve_pluto(pluto)
rate(10)
revolve_all_planets(mercury, venus, earth, mars, jupiter, saturn, uranus, neptune, pluto)
people should start to use vpython. it is much better then pyopengl! 
|