Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Alasdair · Feb 24, 2010 at 09:56 PM · physicsgravityscalemath

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

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!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Eric5h5 · Feb 24, 2010 at 10:29 PM

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Alasdair · Feb 25, 2010 at 09:55 AM 0
Share

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 though

Guess I now have to think up a new little exercise to work on :)

avatar image
2

Answer by Sebas · Feb 24, 2010 at 10:26 PM

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

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image patwolf · Apr 06, 2016 at 09:33 AM 0
Share

The links are both broken but this forum post still works and has references to the source file: http://forum.unity3d.com/threads/unity-able-to-manage-full-scale-stellar-systems.38782/

avatar image
-1

Answer by Tom 5 · Jun 15, 2010 at 06:43 AM

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; }

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image flamer1990 · Mar 13, 2018 at 08:12 PM 0
Share

I tried it and it still caps at 10^9 max

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to scale down physics engine 2 Answers

What is the best way to map the curve of a jump? 1 Answer

Game Scaling Best Practice 0 Answers

Player flies up into the air when walking 3 Answers

Change Gravity? Physics scaling for large objects to behave like normal ones... 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges