Skip to main content
6 events
when toggle format what by license comment
Feb 3, 2020 at 8:48 comment added Luaan @DMGregory Matrices give you extra degrees of freedom. If you only need rotation, imaginary numbers work great - I've used them for rotation in the past (in fact, even in one of my first games, a Tetris clone in Pascal :D). But a 3x3 matrix gives you a simple way to rotate, scale, translate etc.; it's more expensive and somewhat annoying to work with, but more general.
Jan 31, 2020 at 12:39 comment added DMGregory I mention this isomorphism between complex multiplication and 2D rotation in my answer, but I've never yet encountered a game that performs its 2D rotations this way. They seem to almost universally use 2x2 or 2x3 matrices instead. The result is equivalent, but it means we're manually storing the 4 coefficients of FOIL instead of using the fact that i*i=-1. And when we just multiply two vectors, we usually do it component-wise, not treating the y coordinate as imaginary. Maybe I'm overlooking a place where this property of complex numbers is used in games?
Jan 31, 2020 at 9:46 history edited Philipp CC BY-SA 4.0
deleted 546 characters in body
Jan 31, 2020 at 9:34 history edited Philipp CC BY-SA 4.0
added 562 characters in body
Jan 31, 2020 at 9:20 history edited Philipp CC BY-SA 4.0
edited body
Jan 31, 2020 at 9:14 history answered Philipp CC BY-SA 4.0