Advertisement

Sending deltas with floats

Started by July 30, 2003 02:37 PM
2 comments, last by ShmeeBegek 21 years, 6 months ago
Its obvious how to send deltas with integers, just use a smaller type (if you''re using 32 bit but the change < 65536 use 16 bit, etc.). But with floating point it seems to be a bit more complex, does anyone have any ideas on sending good deltas with floating-point values? Thanks, ~SPH
AIM ME: aGaBoOgAmOnGeR
You could use fixed point representation so long as you know the range and accuracy you require. For example, 6.10 format (16 bit, rather than 32) would give you -32 -> +31 with 1/1024 resolution.

You''d need to do the bit munging yourself but it''s straightforward to do.
Advertisement
Fixed point is the best representation for position and orientation in a game. They are, however, difficult to manipulate with standard floating point routines such as sine/cosine/tan/log/exp functions. If your fp requirements can be constrained to trig functions, then you could use CORDIC algorithms to perform those instead of converting to double and back.

CORDIC:
http://www.dspguru.com/info/faqs/cordic.htm
http://www.andraka.com/cordic.htm

http://www.gamedev.net/reference/articles/article406.asp

-cb

PS: Added cordic rotator article.

[edited by - cbenoi1 on August 4, 2003 9:11:24 AM]
Could u break apart the exponent and fracton bits of the floating point and try to quantinize those using ur interger quanitization routines?

-ddn

This topic is closed to new replies.

Advertisement