Question

I'm trying to build a native viewer for cubic panoramas. Here is a web version of what I would like to achieve: http://www.apple.com/html5/showcase/vr/

This type of projection works as follows: The panorama consists of 6 square images which are projected on the inner surface of a cube. The camera is positioned in the center of the cube.

Currently, I'm using 6 CALayers and arrange them in 3D space so that they form a cube. Rotating them works fine using CATransform3DMakeTranslation etc.

The problem is that CALayers are not transparent when seen from behind (they show the same image as the front side). This sucks, because the user can't see the projections inside the cube because the view is blocked by other layers of the cube.

Is there a solution for this problem? I could think of the following: a.) Maybe there's a setting in Core Animation to make layers transparent when viewed from behind? b.) Continuously track the current view direction and manually set the CALayers hidden which would block the view.

What would be the best solution to solve this?

Was it helpful?

Solution

You can simply try setting the doubleSided property to NO.

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