5

It seems that we can show layers and even use a different zPosition for different layers in Core Animation -- however, is it true that there is no easy way to show something with some thickness?

For example, a slice of cheese with a 2mm thickness, or a push button or a coin that is tilted and therefore show a 1mm thickness? Somehow the thickness has to be shown by adding yet another layer to imitate the thickness? So this 2.5D is a more basic 2.5D, where it is a 3D world limited to flat 2D images... while some 2.5D, such as some RPG games, (like Diablo), which are sometimes also called 2.5D but objects in those situation (such as a building) can actually have width, length, and height (thickness). So actually, those are actually quite 3D to me... except most objects are on a 2D map that is tilted sideway.

So back to the question... is it true that in iOS, it is fairly limited to a 3D world of flat 2D images, and going to any width x length x height will require going into OpenGL / CAEAGLLayer?

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
  • Isn't 2.5D thickness usually faked by a drop shadow image? ``zPosition`` controls composite order, I don't think it has relation to 3D effects. – He Shiming Jun 09 '12 at 07:35
  • with CATransformLayer, the zPosition can actually affect the z-coordinate of the image – nonopolarity Jun 09 '12 at 07:45

1 Answers1

2

Yes it's true. Core Animation does 3D animation of 2D objects (layers). You can simulate thickness by building a complex assembly of objects, where you add layers for the edges of your object, but it's a pain.

OpenGL is a much better platform for doing 3D.

Duncan C
  • 128,072
  • 22
  • 173
  • 272
  • Yup. Depending on what you're trying to simulate thickness for, extra layers might work just fine -- say, for a quick coin flip you might just layer a handful of circles on top of each other with some difference in z-position, then flip the group. If the animation is short, the user may notice the illusion of thickness but may not catch the trick to how you made it. – rickster Jun 10 '12 at 05:47