Resolved .

Discussion in 'iOS Programming' started by troop231, Apr 4, 2014.

  1. troop231, Apr 4, 2014
    Last edited: Apr 27, 2014
  2. PBG4 Dude macrumors 68000

    PBG4 Dude

    Joined:
    Jul 6, 2007
    #2
    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. :)

    https://www.cocoanetics.com/2012/08/cubed-coreanimation-conundrum/
     
  3. troop231, Apr 5, 2014
    Last edited: Apr 27, 2014

    troop231 thread starter macrumors 603

    Joined:
    Jan 20, 2010
  4. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #4
    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.
     
  5. troop231, Apr 7, 2014
    Last edited: Apr 27, 2014

    troop231 thread starter macrumors 603

    Joined:
    Jan 20, 2010
  6. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #6
    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.
     
  7. troop231, Apr 7, 2014
    Last edited: Apr 27, 2014

    troop231 thread starter macrumors 603

    Joined:
    Jan 20, 2010
  8. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #8
  9. troop231, Apr 8, 2014
    Last edited: Apr 27, 2014

    troop231 thread starter macrumors 603

    Joined:
    Jan 20, 2010
  10. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #10
    Why do you need to email him? He is linking plenty of sample code you should be able to modify to meet your needs.
     
  11. troop231, Apr 8, 2014
    Last edited: Apr 27, 2014

    troop231 thread starter macrumors 603

    Joined:
    Jan 20, 2010

Share This Page