# Very big numbers (size, mass, etc), Scientific Notation

 0 Hello, I'm currently learning my way aroudn Unity and the scripting languages and as an exercise, i'm making a little demo application where you can control a spaceship orbiting a planet. I was wondering if it is possible to use a realistic scale? Size isn't too much of an issue, as the Earth has a radius of 6000km, and i can set the (currently spherical, as I haven't done any modelling yet!) spaceship to have a radius of 1km. However, the mass of the earth is ~6x10^24, and I'm having trouble working out how to specify this? RigidBody's seem to have a maximum mass of 10000 units? (although as I've done my own gravity model, I can use my own mass value in a script easily enough). I also need to specify the gravitational constant, G=6.7x10^-11. Obviously, I don't have to use real units, and from a gameplay perspective, realistic scales might not be a lot of fun. But i'm trying to simulate this as a learning exercise, so I might as well try and be as accurate as the engine allows me to be! And watching a satellite trace out elliptical orbits is quite satisfying! I assume that trying to make planets orbit the sun will be outside the scope of the Unity Engine (even Sins of a Solar Empire shys away from tackling this)... and I assume, if I wanted to pursue this as a game idea, the sensible appraoch would be to use two scales... a solar-system map, and then "planetary orbit" scale for actually flying ships around. It would be interesting to see what the scale limits are for Unity though :) Thankyou! more ▼ asked Feb 24 '10 at 09:56 PM Alasdair 17 ● 4 ● 5 ● 6 runevision ♦♦ 8.1k ● 29 ● 46 ● 112 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

 0 It's not really possible to use realistic units for such large scales. Unity uses single-precision floating point for the position of objects, which creates precision problems the farther away you get from the origin. For typical usage this isn't a problem, but using the kind of scale you need for planetary distances isn't feasible. In any case, the mass is arbitrary. It's only relevant compared to other objects, so you can define the mass of Earth as 1, for example. more ▼ answered Feb 24 '10 at 10:29 PM Eric5h5 80.1k ● 41 ● 132 ● 519 Thanks for the answers... I'll give that forum thread a read at some point. The good news: As I can't use realistic parameters, I guess my little Earth orbit sim is now complete :) [Just now i've set things up so it feels/looks right rather than being realistic!]Shame I can't use double-precision thoughGuess I now have to think up a new little exercise to work on :) Feb 25 '10 at 09:55 AM Alasdair add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users
 0 There is the perfect thread for you on the forums. HiggyB put together a physics simulation of the inner planets of our solar system, but I think the only way to make this work is by scaling down A LOT. Check this forum thread and a demo of Higgy's orbitsim more ▼ answered Feb 24 '10 at 10:26 PM Sebas 4k ● 12 ● 18 ● 45 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users
 0 You can set the mass of a rigidbody to anything you want in a script. eg. ``````public float mass = 6e24f; void Start() { rigidbody.mass = mass; } `````` more ▼ answered Jun 15 '10 at 06:43 AM add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

By Email:

Topics:

x1866
x459
x386
x211

asked: Feb 24 '10 at 09:56 PM

Seen: 2852 times

Last Updated: Nov 22 '11 at 03:07 PM