Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Overlapping Circles
#11
Here's an even better version. I fixed the proportions as good as I could do it with an equation I made up and I made the orbit of the Moon going around the Earth and Sun close to real life compared to the Earth going around the Sun. 

Code: (Select All)
'3D Earth Orbit and Moon by SierraKen
'Made on July 6, 2022.

_Title "3D Earth Orbit and Moon by SierraKen"
Screen _NewImage(800, 600, 32)
t = 1800
x = 400: y = 300: r = 50
t2 = 1800
cc4 = 100
cc5 = 100
Do
    _Limit 20
    If t < 90 Then t = 1800
    If t2 < 90 Then t2 = 1800
    x2 = (Sin(t) * 360) + 400
    y2 = (Cos(t) * 180) / _Pi / 1.5 + 300
    r2 = (Cos(t) * 180) / _Pi / 1.5 + 50
    x3 = (Sin(t2) * r2 * (y3 / y2) * _Pi) + x2
    y3 = (Cos(t2) * 120) / _Pi / 1.5 + y2
    r3 = (Cos(t2) * 20) / _Pi / 1.5 + r2 / 5
    t = t - .025
    t2 = t2 - .3
    If y2 < 293.75 Then
        'Earth
        For S = .25 To r2 Step .25
            cc = cc + .25
            Circle (x2, y2), S, _RGB32(cc, cc, 100 + cc)
        Next S
        cc = 0
        'Moon
        For S = .25 To r3 Step .25
            cc4 = cc4 + 2
            Circle (x3, y3), S, _RGB32(cc4, cc4, cc4)
        Next S
        cc4 = 0
    End If
    'Sun
    For sun = .25 To 35 Step .25
        cc2 = cc2 + 1
        Circle (x, y), sun, _RGB32(200 + cc2, 200 + cc2, 64 + cc2)
    Next sun
    cc2 = 0
    If y2 >= 293.75 Then
        'Earth
        For S = .25 To r2 Step .25
            cc3 = cc3 + .25
            Circle (x2, y2), S, _RGB32(cc3, cc3, 100 + cc3)
        Next S
        cc3 = 0
        'Moon
        For S = .25 To r3 Step .25
            cc5 = cc5 + 2
            Circle (x3, y3), S, _RGB32(cc5, cc5, cc5)
        Next S
        cc5 = 0
        If y3 < y2 Then
            'Earth
            For S = .25 To r2 Step .25
                cc3 = cc3 + .25
                Circle (x2, y2), S, _RGB32(cc3, cc3, 100 + cc3)
            Next S
            cc3 = 0
        End If
    End If
    _Delay .05
    _Display
    Cls
Loop Until InKey$ = Chr$(27)
Reply


Messages In This Thread
Overlapping Circles - by SierraKen - 07-04-2022, 12:27 AM
RE: Overlapping Circles - by bplus - 07-04-2022, 05:41 AM
RE: Overlapping Circles - by SierraKen - 07-04-2022, 03:21 PM
RE: Overlapping Circles - by James D Jarvis - 07-04-2022, 08:15 PM
RE: Overlapping Circles - by SierraKen - 07-05-2022, 06:57 PM
RE: Overlapping Circles - by SierraKen - 07-05-2022, 08:10 PM
RE: Overlapping Circles - by OldMoses - 07-06-2022, 01:51 AM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 05:57 AM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 06:10 AM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 07:05 AM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 05:27 PM
RE: Overlapping Circles - by bplus - 07-06-2022, 05:59 PM
RE: Overlapping Circles - by bplus - 07-06-2022, 06:03 PM
RE: Overlapping Circles - by James D Jarvis - 07-06-2022, 06:46 PM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 07:03 PM
RE: Overlapping Circles - by dbox - 07-08-2022, 04:28 PM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 08:46 PM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 09:08 PM
RE: Overlapping Circles - by SierraKen - 07-06-2022, 11:10 PM
RE: Overlapping Circles - by DANILIN - 07-08-2022, 01:21 PM
RE: Overlapping Circles - by SierraKen - 07-08-2022, 05:15 PM



Users browsing this thread: 2 Guest(s)