Jump to content
  • Advertisement
Sign in to follow this  
Racky1275

What size is your 3D space?

This topic is 3802 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When defining your 3D world boundaries, what coordinates are you using? Whether it's a board game or an FPS there must be an optimal size for 3D worlds which minimises rounding effects due to the floating point math. Or am I just over thinking things again... [rolleyes]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Racky1275
Whether it's a board game or an FPS there must be an optimal size for 3D worlds which minimises rounding effects due to the floating point math.[rolleyes]

No, actually. The nature of floating point numbers is precisely that it doesn't matter. What matters to floating point accuracy is not absolute magnitudes, but relative magnitudes.

Share this post


Link to post
Share on other sites
I think you're just over-thinking things again.

For most applications, the accuracy and precision (not the same thing) of floating point are going to be quite enough.

Floating point takes exponents 10^-37 to 10^+37, which is a pretty good range in any units.

When you might run into trouble is when you challenge the number of significant digits. E.g., you want to examine molecules in a solar system size world.

Consider: Maybe you have a terrain comprised of 1 square degree (60 naut. miles on a side). With 7 significant digits, you'll have little trouble using locations accurate to a few inches.

If you do run into problems, use double precision. You may have to define your own vector class (D3DXVECTOR3 uses floating point) but, if you need that precision, it's probably an extensive application anyhow.

Share this post


Link to post
Share on other sites

Thanks for the input guys. I think what you are trying to say is that I should stop procrastinating and write some damn code! [oh]

At least I've stopped obsessing about what I deem to be the front of my world.

(Since you are dying to ask, I've decided that its the faces viewed from a position on the negative Y axis, looking towards the origin. Not that it really matters.)

Ok, Back work! Oh, must go get another coffee first.



Think my tyres/tires need some air... better check. [smile]

Share this post


Link to post
Share on other sites
There is actually one thing you can do to get optimal precision - make sure 0,0,0 is in the middle of your world, and not at the edge. That doubles the precision because you get an extra bit of accuracy from the sign bit.

Although you can use any units without too much trouble, In most cases I'd recommend using metres as your world units. That's mostly because it'll make things like physics calculations easier to handle.

Share this post


Link to post
Share on other sites

Thanks for the tips Adam, makes a lot of sense.

I think I've decided that my world is going to be constructed inside a grid ranging from -512 to +512 along the X and Y axis. I just feel safer with powers of two!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!