small medium large xlarge

08 Jun 2009, 19:48
Christoph Ludwig (13 posts)


I was watching screencast 6 to get a feel for how to do perspective transformations. (Good job, by the way!) In MyLayoutManager’s instance method layoutSublayersOfLayer: you set up the holder layer - to which you apply the rotations - and the rootLayer; rootLayer.sublayerTransform becomes the perspective transformation. The general picture is clear so far.

I don’t understand, however, the value you use for rootLayer.zPosition for the off-center pictures. Since you typically have at most one picture to the left and to the right the relevant code essentially comes down to holder.zPosition = -300.0 and rootLayer.zPosition = -300.1. What does this minimal difference give? I ran the code with both layers set to the same zPosition and could not observe any difference. In the screencast you only say it’s a “little bit of a scaling factor”. Could you elaborate a bit what’s the purpose of this scaling factor?



10 Jun 2009, 00:30
Bill Dudney (916 posts)

Hi Christoph,

That appears to be a typo. Sorry!

You must be logged in to comment