Spaceflight Model

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Spaceflight Model

Postby misho » Tue May 04, 2010 11:10 am

Hello,

I am researching into finding the best available solution for a spaceflight physics engine: Launch, staging, orbit, orbit maneuvers, orbit changes, de-orbit, atmosphere braking, landing. From what I've read so far, Newton is suitable for Physics simulation within a confined "world" volume, and optimized for interaction between objects. In this case, I would have a HUGE world volume, a sphere of about 30,000 km radius.

Can anyone enlighten me if Newton can be applied to astrodynamics? And if not, would anyone kindly point me to other possible candidates for this particular case?

Much appreciated,
Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Spaceflight Model

Postby Julio Jerez » Tue May 04, 2010 12:13 pm

well you can use the double presicion library, that will let you do the physcis acuaraly with very large numbers but the world will still be of finite dimentions.
Seem ess words is one of the features planned for Newton 3.0.
large number is not only a problem for physics it is also a problem for graphics, and Newton 3 will adress both those those problems.

if you want to try Newton you can start with the double presicion library and by the time newton 3 is ready you can switch to the float library.
you can do that by planning earlly, for example you make all your code using you only data type for example

#ifdef USING_DPUBLT
#define MYFloat double
#else
#define MYFloat float
#endif

and the you usei that tyep every where. if you test it periodicall so teh it alway work as you make chnages to yor code,
then when you have a realibel seemless library teh usie floats, for maximum profimance, and low memory fooprint, but that it is also as acurate as teh double presition,
you do not get problems. The Newton interface do not changes much from version to version.
Other than that I do not have any othe answer.


Basicall Netwon 3 will intoruce a new funtion call
NetwonGetPhusicalAbress (body, double* position)
but the matrix will alway be relative to a visual AABB,
this ccan be any Camera frustum.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Spaceflight Model

Postby misho » Tue May 04, 2010 1:09 pm

Thanks so much for your answer!

Let me expand this a bit more: I already have "the world": The application has a full-size world environment already built. All I need is a physics engine that will give me a particle trajectory, under thrust and in gravitational field, from surface to orbit. What I have right now is a simple-dumb orbital path calculator, just a circular trig, and it works flawlessly. It computes an xyz of a circular, inclined orbit around the earth, for a time segment.

What I need is an x,y,z position in a 3D cartesian space, but calculated with all the physics properly applied.

Is that possible? Is it possible to use Newton just as a force/displacement calculator?

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Spaceflight Model

Postby Julio Jerez » Tue May 04, 2010 1:30 pm

the double presicion library should be fine.

But like I said In Newton 2.0 you still have to pass a finite world size.
you cna use a Big one, please do no use ridiclually large valoie lei 1.0e-30, you can use 30,000 km box wit will be
3.0e7 so that sould be fine.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Spaceflight Model

Postby JernejL » Tue May 04, 2010 6:09 pm

I build a prototype space engine with newton, and newton 2.0 can handle huge spaces aswell, just set a big world size to fit whatever you have inside it.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Spaceflight Model

Postby misho » Tue May 04, 2010 7:02 pm

Delfi wrote:I build a prototype space engine with newton, and newton 2.0 can handle huge spaces aswell, just set a big world size to fit whatever you have inside it.


Delfi - Thanks! Can you give me some pointers? Any gotchas I have to look out for? I am not only looking for a deep space "asteroid" type engine, but a full-fledged gravity well/orbital modelling with orbital changes (hofmann transfers), orbital inclination (plane) changes, re-entry etc.

How did you / would you handle rocket/spacecraft stacking and staging? Is that possible in Newton? Any info would be much much appreciated.

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Spaceflight Model

Postby JernejL » Wed May 05, 2010 3:48 am

I just produced a arcade space engine similar to some old star trek game, i didn't have actual orbits or anything, i used single precision newton library, and built enoremous sectors of space where i can place space stations and move ships without any issues.
I might upgrade that to newton 2.0 and put a demo of it online, it's a good demonstration for newton.

Stacking stages shouldn't be a problem, i would recommend using a compound collision (i'm not sure a joint would work well for this), you can then rebuild compound collision when stages are removed.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Spaceflight Model

Postby misho » Wed May 05, 2010 1:41 pm

Delfi wrote:I just produced a arcade space engine similar to some old star trek game, i didn't have actual orbits or anything, i used single precision newton library, and built enoremous sectors of space where i can place space stations and move ships without any issues.
I might upgrade that to newton 2.0 and put a demo of it online, it's a good demonstration for newton.

Stacking stages shouldn't be a problem, i would recommend using a compound collision (i'm not sure a joint would work well for this), you can then rebuild compound collision when stages are removed.


Delfi - Thanks! I am reading up in the Wiki on your suggestions. One thing I'm unsure of is, does Newton provide graphics engine as well as Physics engine? That is, when you talk about convex/concave shapes, boxes, cylinders added as compound collision objects, are you talking about abstract shapes for the purpose of collision detection, or the actual, visible 3D shapes? My "world" already has the 3D objects and environment, so I don't want to add any real visible shapes. Sorry about the general nature of the question, I haven't had a chance to run a tutorial yet, which would probably answer this.

You are in Slovenia? I am from Croatia (Zagreb) but live in Toronto, Canada.

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Spaceflight Model

Postby JernejL » Wed May 05, 2010 2:18 pm

Newton is purely a physics simulation & collision engine (you can use it as whole, or each part separately), and not a graphical engine.

Compound collisions and shapes are newton world primitives, which are used for simulating shapes, i can produce you some graphics illustrations, but the wiki has a topic on this aswell.

If your enginne already handles the graphics then adding newton should be no problem, as the I/O interface between newton and graphical engine are simple 4x4 matrixes.

And, yes, i am from Slovenia, and i still live here :(

EDIT: here is example of my space game engine, i upgraded it quickly to newton 2.20, and included some ship models i could due to huge space usage (enoremous textures), please note that this is a arcade game and not a proper space sim, but it does demonstrate that huge space sizes and complex space objects are possible. you can do proper space simulation, whatever kind of precision and detail you want.

Tech demo:
http://mathpudding.com/temp/STSC%20newt ... 20demo.rar

The ships and space stations there are built of of small pieces to form concave complex compound collisions like this one, Julio: this is probably one heck of a test example for compound collisions :D
Image
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Spaceflight Model

Postby thedmd » Thu May 06, 2010 9:16 am

I had tried to play this demo, but there is a localization related problems. Delphi claim that "0.0" is not a valid number, which is valid form my localization where "0,0" is valid floating point value. May you use some neutral culture for floating point conversion?
thedmd
 

Re: Spaceflight Model

Postby JernejL » Thu May 06, 2010 9:23 am

Ah yea, you could set the the decimal separator to '.' temporarly in regional settings and it will work, but i will make a fixed demo in the evening.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Spaceflight Model

Postby thedmd » Thu May 06, 2010 9:31 am

Thanks. : )
thedmd
 

Re: Spaceflight Model

Postby misho » Thu May 06, 2010 10:41 am

Delfi wrote:Newton is purely a physics simulation & collision engine (you can use it as whole, or each part separately), and not a graphical engine.

Compound collisions and shapes are newton world primitives, which are used for simulating shapes, i can produce you some graphics illustrations, but the wiki has a topic on this aswell.

If your enginne already handles the graphics then adding newton should be no problem, as the I/O interface between newton and graphical engine are simple 4x4 matrixes.

And, yes, i am from Slovenia, and i still live here :(

EDIT: here is example of my space game engine, i upgraded it quickly to newton 2.20, and included some ship models i could due to huge space usage (enoremous textures), please note that this is a arcade game and not a proper space sim, but it does demonstrate that huge space sizes and complex space objects are possible. you can do proper space simulation, whatever kind of precision and detail you want.

Tech demo:
http://mathpudding.com/temp/STSC%20newt ... 20demo.rar

The ships and space stations there are built of of small pieces to form concave complex compound collisions like this one, Julio: this is probably one heck of a test example for compound collisions :D
Image


Delfi, this is simply awesome! Are you telling me that each colored part is a separate segment of the space station that can interact/crash into others? So if you were to "explode" station, they would all separate?

I have my visuals all lined up and pretty, now I have to give them realistic physics!!

Misho
Orion_Docked1.jpg
Orion_Docked1.jpg (124.59 KiB) Viewed 3751 times
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Spaceflight Model

Postby JernejL » Thu May 06, 2010 5:44 pm

misho wrote:Delfi, this is simply awesome! Are you telling me that each colored part is a separate segment of the space station that can interact/crash into others? So if you were to "explode" station, they would all separate?


It is a separate segment of the space station, that builds complex concave shaped meshes, they are totally rigid, it does not deform / break, but it is possible (my graphics engine wouldn't support it in current state)

I uploaded a fixed demo, the localisation problem should no longer be there now.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Spaceflight Model

Postby thedmd » Thu May 06, 2010 6:07 pm

Huh! Looks great. It will be fun to explore the space in NCC ; )

Thanks for fixes. Now everything works.
thedmd
 


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron