Skip to main content
GameDev.net gamedev.net
🔒 Locked

Object space transformations *floats*

Started by Basiror Mar 16, 2005 at 10:19 AM 3 replies 850+ views
Original Post
Basiror
Basiror
Hi I am working on a 3d map editor and just wondered til when i can use worldspace transformations instead of object space transformations IEEE 754 float standard save floats as follows 1 bit sign 8 bit exponent rightshit = exponent - 127 23 bits mantissa aka decimal letters lets say i want 0,000001 precision now when i multiply 4096,000001*4096,000001*4096,000001 dont i exceed the boundaries of the ieee standard?
http://www.8ung.at/basiror/theironcross.html
Trap
Trap
You want exact results?
Basiror
Basiror
well

i don t want to screw the data inside the mapeditor

editing and suddenly your convex brush turns invalid when you move it because some dot products deliver false values, sucks doesn t it?


my EPSILON is 0.0001f so the precision should at least be 0.0001f>= desired precision otherwise plane equations might fail
http://www.8ung.at/basiror/theironcross.html
Trap
Trap
Don't use epsilon values that aren't representable as floats. Might result in really strange bugs. What Every Computer Scientist Should Know About Floating-Point Arithmetic

What kind of transformations do you do?

A somewhat usefull technique is to move the world a bit so that it doesn't contain the float origin (with some safety margin to it). That way you don't have regions that are far more precise than others. So it is safer to move stuff around.
Basiror
Basiror
well thats what i thought of

instead of worrying about precision of my floats i just translate my objects to the worldorigin and do my calculation there

small numbers result in small floats and increase precision


but what i am looking for is a maximum distance that i could use to decide whether to translate to the origion or not
http://www.8ung.at/basiror/theironcross.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.