Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

How would you simulate Paper Folding (Origami specifically)

Discussion in 'Scripting' started by emalmud, Jul 23, 2020.

  1. emalmud

    emalmud

    Joined:
    Mar 5, 2014
    Posts:
    7
    I know similar things have been asked before,
    ultimately I'm trying to simulate paper folding in 3D. Here is what i've tried.

    1. Develop Inverse Kinematics - Create 3D objects that are already broken up into sections and on selection fold them over a selected axis. This way works, but I don't have a real way of deciding when things should be connected. So after the first fold its almost like i lost all logic defining it as "paper" (See attachment)
    This way would still need a fancy way of determining what sections should be together. and i feel at that point the math behind everything might get SUPER complex.

    2. Cloth Physics - Looked so off and most likely isn't worth exploring further.
    Maybe I will try the ObiCloth?

    3. Mesh Slicer - This could work, but inherently will have the same problem as 1. Where I need some way to "remember" where folds take place so the paper isn't "ripped" in the middle on a second fold.

    4. Looked into this site. http://apps.amandaghassaei.com/OrigamiSimulator/
    Spent a fair amount of time looking at the code. While something like this seems amazing to me because of the way the algorythem works. I think it would be difficult to implement this in Unity. Would love some direction on this as well.

    5. Rigging a piece of paper with a TON of "folds/creases" and manipulating them in unity.
    This might be the best way forward imo, but ive never done rigging before!


    I have a fair bit of experience in Unity and Software, but not in this level of Mathematics in spaces.

    Thanks!
     

    Attached Files:

    Last edited: Jul 23, 2020
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    37,361
    It is an interesting engineering / space problem to think about this, but really it is completely predicated on how you define your problem space.

    For instance if you had lots of art time you would just make models and animate them from sheet to closure, and the interactive portion would just be an animator scrubber, back and forth.

    If on the other hand you want a completely-generic paper folding simulation that begins to simulate thickness where 1, 2, 4, 8 layers of paper go, as well as making it impossible to fold beyond like 7 times because it looks curved, that is a completely gnarlier problem to solve.

    So it sorta comes down to what do you assume your game will do?
     
  3. emalmud

    emalmud

    Joined:
    Mar 5, 2014
    Posts:
    7
    The ultimate goal here is to make something that the user can make whatever they want, but i'm unsure if that goal is just too complex to be realistic.

    As for thickness That's some of the harder aspects.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    37,361
    Might be easiest for you to go into your favorite 3D program (such as Blender) and use it as though it were an origami package and try to actually fold a simple origami shape. Origami is not only folding: one must select the precise line, which implies a UI of some kind, and since a 3D program already solves that, it might give you ideas for how to approach the design.
     
  5. DeskWolf

    DeskWolf

    Joined:
    Oct 15, 2023
    Posts:
    1
    Hello, I know I'm three years behind, but I am doing a similar project and was wondering what ever came of this.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    37,361
    There was no indication that any actual work was ever performed for this prototype.

    But my two suggestion posts above stand as-is.

    The problem space of folding paper hasn't really changed.

    Let us know what you find out!
     
  7. emalmud

    emalmud

    Joined:
    Mar 5, 2014
    Posts:
    7
    I did go the blender route and got something working because its essentially just rigging a model.

    I also created a prototype that splits a mesh and lets you fold the paper where you control the newly created side.
    This worked to a degree but i had some issues with any sort of complex fold. Meaning anything more than folding to make a crease had issues with shapes because i didnt really have a great way to know which direction each new piece should go. Ultimately possible i think, but i think you would need some way for the user to select things and specify the fold type and such. Ultimately not really what i was looking for because ideally i was making this as a relaxing puzzle game not a simulation.