Mintoris Forum

Author Topic: Graphics orbits  (Read 5081 times)

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Graphics orbits
« on: Feb 15, 2012, 03:35 PM »
Hello, is there a graphics function for moving objects around in a circle like planets in their orbits, Harold.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Graphics orbits
« Reply #1 on: Feb 15, 2012, 04:08 PM »
The following code draws a circle point by point.

Degree
Graphics On

x = ScreenX() / 2
y = ScreenY() / 2

r = 50

For i = 0 to 360

  Point x + cos(i) * r, y + sin(i) * r

Next i

Wait 10000



You can change the Point command to a draw bitmap command with a wait to get the effect you want.  This is a circular orbit, not an ellipse like an actual planet.

-Chuck

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #2 on: Feb 15, 2012, 06:58 PM »
Hello Chuck, thanks, I'll try that, I figgure I can get the same total orbit time in a circle that I would get in an ellipse, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #3 on: Feb 15, 2012, 09:01 PM »
Hello Chuck, thanks, that does exactly what I wanted, now I'm going to go to work on my program, thanks again, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #4 on: Feb 16, 2012, 04:38 PM »
Hello Chuck, I posted the first step in my graphics solar system program, thanks, Harold.

robotMeiker

  • Full Member
  • ***
  • Posts: 49
Re: Graphics orbits
« Reply #5 on: Feb 21, 2012, 07:05 AM »
Hello Harold:

Where is your program posted?

Ooops, I found it, I'm still learning how to use this forum.

Cesar
« Last Edit: Feb 21, 2012, 07:09 AM by robotMeiker »

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #6 on: Feb 21, 2012, 03:24 PM »
Hello Cesar, Chuck and Mintoris pretty much let's me do whatever I dream up, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #7 on: Feb 21, 2012, 03:42 PM »
Hello Cesar (robotMeiker), I have have had several robots, I keep thinking about getting into that area of Chucks' life, Harold.

George

  • Full Member
  • ***
  • Posts: 22
Re: Graphics orbits
« Reply #8 on: Feb 21, 2012, 06:32 PM »
Hey Harold,
   Here is an ugly little routine that might help you. It's pretty simple.

George

George

  • Full Member
  • ***
  • Posts: 22
Re: Graphics orbits
« Reply #9 on: Feb 21, 2012, 06:36 PM »
I should have just put it out for you just to look at if you didn't want to download:

  Graphics On
  Degree
  Setscale 480,800
  CX=ScreenX()/2
  CY=ScreenY()/2
  width=200
  height=50
  incSize = 1
  year=0
  Do while year<3
    year=year+1
    For i = 0 To 360 Step incSize
      Color 0,0,0
      CLS
      X = (Cos(i)*width)+CX
      Y = (Sin(i)*height)+CY
      Color 50,20,10
      Circle  CX,CY,20,1
      COLOR 10,100,30
      Circle X,Y,3,1
      Wait 10
    Next i
  loop
  Wait
  End

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #10 on: Feb 21, 2012, 07:22 PM »
Hello George,it's good to hear from you, I know you are probably working on a new project. Thanks again for getting me going on Mintoris graphics. I downloaded orbit.bas, it will take me awhile to digest it, thanks, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #11 on: Feb 22, 2012, 01:37 AM »
Hello George, I'm out of slots so I attached orbit.bas to my solsys file and ran it and it looks good. I havn't deciphered it yet but I have been thinking about doing a program on the 4 Galilean moons of Jupiter so I will see if I can make it do them, thanks, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Graphics orbits
« Reply #12 on: Feb 22, 2012, 07:00 AM »
Hello George, I studied your program and took out the parts that let me do my 4 moon orbits and merged them with what I learned from you before and the new program will be solsys35, thanks, Harold.