Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. python just for fun

python just for fun

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
pythonvisual-studioquestion
10 Posts 6 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shahab96
    wrote on last edited by
    #1

    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), origi

    B S H 3 Replies Last reply
    0
    • S shahab96

      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), origi

      B Offline
      B Offline
      BC3Tech
      wrote on last edited by
      #2

      there is a flaw in your design. pluto isn't a planet :)

      G S 2 Replies Last reply
      0
      • S shahab96

        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), origi

        S Offline
        S Offline
        Sterling Camden independent consultant
        wrote on last edited by
        #3

        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.

        Contains coding, but not narcotic.

        S 1 Reply Last reply
        0
        • B BC3Tech

          there is a flaw in your design. pluto isn't a planet :)

          G Offline
          G Offline
          grgran
          wrote on last edited by
          #4

          That's ok, cause the Milky Way isn't a solar system :-) Maybe I should start pushing (m) as the smart-ass emote ;-)

          1 Reply Last reply
          0
          • B BC3Tech

            there is a flaw in your design. pluto isn't a planet :)

            S Offline
            S Offline
            shahab96
            wrote on last edited by
            #5

            :confused: wth? when did that happen?:confused:

            H 1 Reply Last reply
            0
            • S Sterling Camden independent consultant

              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.

              Contains coding, but not narcotic.

              S Offline
              S Offline
              shahab96
              wrote on last edited by
              #6

              ....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. ;)

              C 1 Reply Last reply
              0
              • S shahab96

                ....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. ;)

                C Offline
                C Offline
                cjoki
                wrote on last edited by
                #7

                on pluto http://news.nationalgeographic.com/news/2006/08/060824-pluto-planet.html[^]

                Chris J www.redash.org

                S 1 Reply Last reply
                0
                • C cjoki

                  on pluto http://news.nationalgeographic.com/news/2006/08/060824-pluto-planet.html[^]

                  Chris J www.redash.org

                  S Offline
                  S Offline
                  shahab96
                  wrote on last edited by
                  #8

                  oh...i never knew that. thanks for the update cjoki :D

                  1 Reply Last reply
                  0
                  • S shahab96

                    :confused: wth? when did that happen?:confused:

                    H Offline
                    H Offline
                    HimanshuJoshi
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    • S shahab96

                      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), origi

                      H Offline
                      H Offline
                      HimanshuJoshi
                      wrote on last edited by
                      #10

                      Better 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.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups