# Physics Simulation Forum

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Posted: Sun Jun 24, 2012 9:07 pm

Joined: Sun Nov 13, 2011 5:23 am
Posts: 3
I think it makes more sense to use fixed-point to represent position. please correct me if I'm wrong.

reason: precision of floating-point depends on the location, and it is highly clustered around 0.
consequence: you can't expect position-invariant precision.
1. people should avoid positions too far from the origin.
2. precision at (0,0,1000000) depends on the axis direction

using fixed-point
pro: guarantees position-invariant precision.
con: max value is fixed, and you should use proper scale.

But I would say the fixed-point's con is not actually that bad, since too high value is discouraged even with the floating point. It only makes the bad practice explicitly impossible.

The attached imgs are

1. fixed point resolution with 7-bit integer.
2. floating point resolution with sign bit, 3-bit exponent and 3-bit mantissa
both are scaled to have the same max.

 Attachments: fixed_point.png [ 18.12 KiB | Viewed 1286 times ] floating_point.png [ 19.51 KiB | Viewed 1286 times ]
Top

 Posted: Mon Jun 25, 2012 8:31 pm

Joined: Sat Aug 19, 2006 11:52 pm
Posts: 198
I've come across this idea a couple times; here's a blog post that mentions the same concept (using 32bit or 64bit ints to store position): http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[A%20matter%20of%20precision]]

(sorry about the lack of proper link, the formatting of the URL seems to be breaking this forums' embedding code)

In that article, the author suggests that implementing this would be straightforward -- position is stored in fixed-point, and all calculations happen in a local space with floating-point. I suspect that it's not as simple/easy as that (or, maybe it is and I'm not understanding the idea well enough), so if you have any experience to share, I'd be interested in hearing about it.

Top

 Posted: Wed Jun 27, 2012 5:15 pm

Joined: Tue Feb 20, 2007 4:56 pm
Posts: 190
... or you can basically have the best of all worlds and just use doubles.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities