3 ms·
Yikes! I use vector math (dot and cross products) to do all my game physics. Far fewer operations (two multiplies, and add, sometimes a divide). All the singula
by JoeAltmaier 7y ago
Yikes! I use vector math (dot and cross products) to do all my game physics. Far fewer operations (two multiplies, and add, sometimes a divide). All the singularity issues were in one place, and meant something special each time, so could be dealt with in an orderly way. And could be all fixed-point or integer, no need for floating point at all.
- jacobolus 7y agoYes, trigonometry should be avoided whenever possible (which is much more than people often expect) in favor of vector methods in pretty much every context. If someone wants a single number for representing a rotation, consider using the stereographic projection (instead of angle measure), which takes only 1 division to go back and forth to cartesian coordinates. Floating point is fine for modern hardware though.
- syspec 7y agoI consider it sort of a phased approach. You discover these trigonometry methods. Then you slowly intuitively understand them. Then you start to seek out new ways of expressing things (such as matrices). And you then understand why trigonometric versions have pitfalls (such as if you needed to apply something to all pixels in an image)