Search code examples
iphoneiosquartz-2d

iOS Quartz 2D: draw an image simulating y axis rotation?


I want to do this: draw an image using Quartz 2D, the image look like rotated according to its y axis in a 3D space, like this: enter image description here

Is Quartz 2D capable to do this?


Solution

  • No, you cannot do this directly with Quartz 2D. It supports only affine transformations, which always preserve parallel lines.

    (It's clear that you want the parallel lines on the top and bottom edges of your figure to become non-parallel.)

    The term you're looking for is "perspective transformation", if you want to search for other ways to achieve this result.