Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Simulating the speed of light

Author
Message
Sonic 91 Software
19
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 13th Nov 2009 18:01
I am trying to simulate the speed of light in a 3D solar system project I'm creating (nothing as grand as some of the other efforts I have seen on these forums, credit to those who have created them!) It seems like a popular choice of project so I thought I'd have a go. Some problems:

1. How can I calculate the speed of light with regards to the sync rate and movement of the camera?

2. May be a rookie mistake by me, but why is Neptune trying to get a front row seat? (seems to be sitting at 205M km from the sun, between Earth and Mars when it's supposed to be much further away!

It is very basic coding as I haven't coded for a long while.



The Solar System I've created is roughly full size, with 1 unit of 3D space in DB being 1km.

Fight the good fight of faith,
Lay hold on Eternal Life.
-1 Timothy 6:12-
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Nov 2009 18:34
You've been gone a while!

For number 2.
As far as planet placement, your values may be too big. The largest value DBC can handle is (2^31)-1 which = 2147483647 . When you apply values larger than that, they will first turn to negative, then they will start to wrap. In Neptunes case, 4500000000 ends up being 205032704.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Nov 2009 21:13
To fit it in DB's ranges, you have to scale everything down by a magnitude of thousands. It's only when you do the research, you realise just how damn big our solar system actually is.

Not 100% sure of this, but I seem to remember reading once that if the sun was the size of a pea and the Earth was a pin head, then to scale, Neptune would literally be 1 mile away.

If you used a scale like what you mentioned, users of your program would probably be dead years before they reached Saturn!

Try making 1 3D unit equal 1000, 10000 or even 100000 km.

Don't forget, 3D units are floats so you can move a spacecraft .00001 3D units if necessary. At 1000 scale, 186000 miles per second can be calculated as 186 3D units per second.

I have the feeling though, that at light speed, you'd maybe zip across the solar system pretty sharpish...

TDK

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Nov 2009 21:21
Quote: "Not 100% sure of this, but I seem to remember reading once that if the sun was the size of a pea and the Earth was a pin head, then to scale, Neptune would literally be 1 mile away."

Have you been watching Porridge TDK?
Are you British or American? I've never been able to tell lol

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Nov 2009 21:35
Have you been watching Porridge

Not recently. I saw a few episodes when it was new on TV back in the 70's/80's or whenever it was. Why? I don't see the connection...

Quote: "Are you British or American?"


British of course - can't you tell that I spell things correctly...

Only kidding - don't want to start an 'us and them' flame war across the Atlantic. Lol!

TDK

Sonic 91 Software
19
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 13th Nov 2009 22:59
Quote: "You've been gone a while!"


Aww, someone noticed! thanks!

Quote: "As far as planet placement, your values may be too big. The largest value DBC can handle is (2^31)-1 which = 2147483647 . When you apply values larger than that, they will first turn to negative, then they will start to wrap. In Neptunes case, 4500000000 ends up being 205032704."


I thought there might have been a value issue with regards to what DBC can handle. I'll try scaling it down. Turning to negative will explain why Uranus had a negative value, didn't know about the wrapping, but that would explain Neptune. As far as Pluto goes, that was in the right place all along, even though it's further out than Neptune. Hmm...

Quote: "I have the feeling though, that at light speed, you'd maybe zip across the solar system pretty sharpish..."


Not necessarily. At the speed of light it's 8 minutes from the sun to Earth and 5 hours to Pluto.

Our solar system is very big. Might explain why DBC has trouble fitting it all to 1 unit = 1km scale. Back to the drawing board on my virtual universe project...(just kidding!)

Thanks for your help guys!

Fight the good fight of faith,
Lay hold on Eternal Life.
-1 Timothy 6:12-
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Nov 2009 00:17 Edited at: 14th Nov 2009 00:18
Quote: "Why? I don't see the connection..."

There was one on the other day where the stupid one was trying to explain a similar model where Neptune would be in Johanesburg.

Quote: "Only kidding - don't want to start an 'us and them' flame war across the Atlantic. Lol!"

must suppress... jokes...

@Sonic
sorry somehow I've managed to hijack your thread.
good to see you back

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright

Login to post a reply

Server time is: 2024-04-19 23:50:21
Your offset time is: 2024-04-19 23:50:21