Wednesday, August 6, 2014

Matrices

Hi guys. Yeah sorry, I know it's been a while since my last update but I've been busy with life stuff...

Today I focused on learning about matrices and how they're freaking awesome for vector graphics because you can do all your transformations to the matrix first before applying it to a shape. This means you'd only need to do ONE transformation calculation per point, as compared to doing each transformation one at a time for every single point (which can be costly when there's a lot of points and a lot of transformations).

Here's a little animation I threw together where I manipulate a shape using a matrix.


This is also really nice for doing cumulative transformations on children of parent entities - a topic  which will be relevant in the near future. We'd only need to pass down the resultant transformation matrix from the parent to the child when calculating the new shape the child would form after the transformations are applied. This way, any transformations done to the parent will directly affect the child as well.

No comments:

Post a Comment