Question

I mean, if I have an object and I apply 3 transforms to it, for example, suppose I don't know what each transform is doing, but I have the matrices.

So, I have

Object X > transform1 > transform2 > transform3 > final result

is there a way to obtain an Affine Transform that can represent the 3 transforms, so I can obtain the same result just doing one transform? For example

Object X > super transform > final result

where super transform = transform1 > transform2 > transform3

how do I do that on the iphone sdk using CGAffineTransform ?

thanks for any help.

Was it helpful?

Solution

Have a look at CGAffineTransformConcat(). You can use this to combine two transformations. If you want to combine three transformations into one, something like this should work:

// Assumes you have CGAffineTransform transform1, transform2, transform3

CGAffineTransform finalTransform = CGAffineTransformConcat(CGAffineTransformConcat(transform1, transform2), transform3);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top