sujithkrishnan
sujithkrishnan

Reputation: 71

How to create a 3D UIView in iPhone apps

I like to create a 3D view, so that if i swipe it will transform and rotate on vertical axis and go perpendicular to device screen. I like the view edges to have some thickness so that it will look like so

Upvotes: 1

Views: 998

Answers (1)

jer
jer

Reputation: 20236

There are a couple ways you can do this, I'll only talk about OpenGL because of this post which details another way.

What you need to do is get your current context so you can generate a texture from it, apply it to a box that you set up, and rotate it how you want. Any number of OpenGL tutorials can go into further depth. I don't really want to pollute this post with tutorial-like content.

But the idea is basically to transition between two views, you grab an image representation of what the views looks like now, generate textures from those images, apply them to each side of the box you want, and go from there.

If you get stuck, you can look at EPGLTransitionView which almost does what you want in its Demo3Transition class.

Upvotes: 2

Related Questions