Search code examples
ios6core-animation

CATransform3DMakeTranslation parameters


I am working on an ios application and using Core Animation.

Can anyone please explain the parameters of CATransform3DMakeTranslation, CGFloat tx, CGFloat ty and CGFloat tz?

I am guessing tx and ty represent the x and y coordinates of the object but what is 'tz'?

thanks in advance, Dan.


Solution

  • The tz parameter controls the depth of the translation, the amount the transform will cause the layer to move "in and out" of the screen. Normally this will not change things much, it will just cause layers to appear on top or below other layers. It is however totally possible to do complete 3D rendering with perspective using core animation. Check this blog for an example:

    http://watchingapple.com/2008/04/core-animation-3d-perspective/