07-30-2018, 11:55 PM
Hi,
Interesting subject, but this one goes beyond Tilengine itself. I recommend you a good tutorial about linear algebra and affine transformations. It's not really that hard, you don't need to understand the math itself, just how to apply some basic receipes:
Interesting subject, but this one goes beyond Tilengine itself. I recommend you a good tutorial about linear algebra and affine transformations. It's not really that hard, you don't need to understand the math itself, just how to apply some basic receipes:
- Grab a simple linear math library that supports points, vectors, and matrices,
- There are 3 basic linear transformations: rotation, translation and scale,
- Each of these transformations has a standard "template" where you encode the desired values,
- Multiple transformations can be chained by multiplying two matrices (order matters: it's not the same translate and then rotate, than first rotate and then translate)
- To apply a transformation to a point, you multiply the source point by the transformation matrix that encodes your desired composite transformation,