IOS: creating a 3D compass

I want to make a 3D metal compass in iOS that will have a movable cover. That is, when you touch it with three fingers and try to move your fingers up, the lid continues to move with your fingers, and after a certain distance it opens. After you pull it out using 3 fingers again, it closes. I attached a sketch to what I think. my compass animation

Is it possible to use basic animations and CALayers? Or will I have to use OpenGL ES?

+6
source share
1 answer

First you must obviously create a textured 3d model in an application, such as 3Ds Max or Maya. Then export it to any suitable format. The simplest is OBJ (there are many examples on how to download it). There are two options in animation:

  • Make the animation manually by rotating the cover object. This is probably the easiest way to do this.

  • Create animations in a 3D editor, and then interpolate between frames. By doing this, you can get a much more realistic look. However, in this case, the OBJ format is not suitable, but there is COLLADA. To download it, I suggest using the Assimp library.

And if you don't need some kind of advanced pursuit, another option is to use pseud 3D: just imagine all the frames of the compass animation and use this animation that applies to 2d text.

+1
source

Source: https://habr.com/ru/post/918752/


All Articles