Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS : Creating a 3D Compass

I want to make a 3D metal compass in iOS which will have a movable cover. That is when you touch it by 3 fingers and try to move your fingers upward the cover keeps moving with your fingers and after certain distance it gets opened.Once you pull it down using 3 fingers again, it gets closed. I have attached a sketch about what I'm thinking. my compass animation

Is it possible using core animations and CALayers? Or would I have to use OpenGL ES?

like image 719
Munim Avatar asked Jun 22 '12 12:06

Munim


1 Answers

First you should obviously create a textured 3d model in app like 3Ds Max or Maya. Then export it to some suitable format. The simplest one is OBJ (there are lots of examples about how to load it). There are two options about animation:

  1. Do animation manually by rotating the cover object. It's probably the easiest way to do that.

  2. Create animation in you 3D editor and then interpolate between frames. By doing this you can get much more realistic view. However in this case OBJ format is not suitable, but COLLADA is. To load it I suggest to use Assimp library.

And if you don't need some advanced interraction another option is to use pseude 3D: just pre render all the compass animation frames and use that animation applied to 2d texture.

like image 198
Max Avatar answered Nov 01 '22 14:11

Max