Separate names with a comma.
Discussion in 'iOS Programming' started by troop231, Apr 4, 2014.
I did an internet search and found this neat tutorial that uses core animation and 3d transforms to make a cube out of a flat cross-shape. Maybe you can adapt it to your needs?
I'm going to play with it when I get back to my computer.
Core Animation is commonly referred to as "2.5D" It lets you create animations of flat objects (layers) in 3D. It does NOT let you manipulate 3D objects.
Your paper airplane is a 2D object until you begin folding it.
You could break up your paper into a bunch of views/layers, with a seam at each fold. You'd have to take the image of the piece of paper and slice it into pieces, and feed those pieces in as the content of each of your layers.
then you would have to work out the math to transform your views in 3D. Things would get very ugly when you fold the already-folded paper with more seams. I don't know how you would do that.
It would be better to use OpenGL, or one of it's wrappers. You would map the image of your paper into a texture, and then map that texture onto a 3D shape of a flat piece of paper. You would need to slice up the 3D paper shape into enough triangles to make all the different folds that you need. Then you would need to write code that animated moving the vertexes of your paper shape to create the folds.
Apple's new SceneKit API would probably make this a lot easier, although I haven't used it. I suggest researching SceneKit first.
Core animation deals with flat, rectangular 2D objects in 3D space. You can have different 2D objects at different angles to each other, but that's it. No folds of any kind. The only way you'd be able to do that is to break each part where there is a fold into 2 parts, and set them up so they intersect so it LOOKS like a fold. It would be awful.
Much better to use a real 3D modeling environment like OpenGL or SceneKit.
I was playing with somewhat related stuff the other day and came across this article:
I think it will really help as it discusses pretty much what you want to do, with the exception of folding at right angles!
Why do you need to email him? He is linking plenty of sample code you should be able to modify to meet your needs.