Visualizing floating point precision loss, or "why #gamedev stuff behaves badly far from the origin"
The blue dot is end of the desired vector. The black dot snaps to the closest representable point (in a simplified floating point grid with only 4 mantissa bits)pic.twitter.com/o1HKYByIbS
Only because a size of a vector is used in normalization. So I want to move thing A toward thing B, and they're really far away. To use the pluto distance example, say your ship is at the sun and you want to plot a course to pluto. normalize(plutoPos - shipPos);
-
-
Right, so "plutoPos" and "shipPos" are both fixed-point numbers. But as soon as you subtract one from the other, that's a RELATIVE vector, and it's totally valid and sensible to store that in floats, because (0,0,0) has an interesting meaning (you're already there!)
-
That's what this line in the blog post means: " All you ever do with these is subtract one position from another (to produce a float32 delta), or add a (float32) delta to a position."
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.