Question

I've got a CATransformLayer with a few CAShapeLayers as its children. The CAShapeLayers are at different z-Positions in the 3D space. Once I rotate the whole scene in 3D, some of the CAShapeLayers disappear at certain angles but they shouldn't. It's absolutely clear that they still should be visible on the screen.

When rotating a bit further they reappear.

What can I do to be sure that my layers are always visible on screen when they should?


Here's a small demo project that shows the issue pretty well. I should also say that I'm using perspective by adjusting the m34 of the transform.

Setting 0 is the Idenditiy + perspective Setting 1 & 2 are very close together rotation wise, just that with one setting the circle disappears and with the other not

https://dl.dropboxusercontent.com/u/40859730/Disappearing.zip

Was it helpful?

Solution

I found out that you have to set the frame property of all sublayers of the CATransformLayer in order to make them not disappear or have wrong z-Ordering.

Though this leads to my next problem - when setting the frame the performance decreases significantly: CATransformLayer - Performance issues when setting frame of sublayers

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top