Search Unity

Page Curl

Discussion in 'iOS and tvOS' started by bergerbytes, Feb 7, 2010.

  1. bergerbytes

    bergerbytes

    Guest

    Ok, I'm guessing the answer will be "no" or "go buy advanced" but I just want to ask to make sure.

    Is it possible to do the page curl effect with unity. It seems like a good fit with the game I'm making but totally not necessary.

    Thanks for the help,
    -Mike Berger
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    if you just want it to do it automatically you could potentially achieve it through using a bone based mesh animation. but it will cost a lot of performance if doable at all.

    if you want it to make the curl being driven by finger movement, then no
     
  3. bergerbytes

    bergerbytes

    Guest

    no, not by finger movement. This isn't an iPad. =]

    I was just talking about a pre-set page curl / turn animation but the more I think about it the less I think it will happen.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    its pretty hard to achieve it, as you have to do it through bone animation. Unity doesn't over vertex animation.

    Once OpenGL ES 2.0 is supported you could use a vertex shader but it would be a 3GS only thing.
     
  5. bergerbytes

    bergerbytes

    Guest

    What about animating it in Pixelmator frame by frame then animating the 100 images?

    I'm just thinking out loud..
     
  6. Zoneman

    Zoneman

    Joined:
    Feb 6, 2010
    Posts:
    42
    Last edited: Jul 13, 2011
  7. AbgaryanFX

    AbgaryanFX

    Joined:
    Jan 9, 2010
    Posts:
    167
  8. Phil W

    Phil W

    Joined:
    Dec 21, 2008
    Posts:
    231
    You could snapshot the pages into a sequence of meshes.

    If you're using Max, try something like this:

    Code (csharp):
    1.  
    2.  
    3. // create a snapshot of the selected mesh at each frame in the Timeline
    4. // works on skins, modifiers, whatever. Use Mesher or Blobmesh if you want to use it on particles.
    5.  
    6.         mainmesh = $
    7.            
    8.     for t = animationrange.start to animationrange.end
    9.         do
    10.             (  
    11.                
    12.             sliderTime=t
    13.            
    14.             snap=snapshot(mainmesh)
    15.  
    16.             snap.visibility = linear_float()
    17.        
    18.             animate on at time 0 snap.visibility.controller.value=0
    19.  
    20.             if t > 0 do
    21.             (
    22.                 animate on at time (t-1) snap.visibility.controller.value=0
    23.             )
    24.             animate on at time t snap.visibility.controller.value=1
    25.             animate on at time (t+1) snap.visibility.controller.value=0
    26.  
    27.             hide(snap)    // comment this out to prevent it hiding the results
    28.            
    29.             )
    Displaying them in Unity is simple enough; treat each mesh like a sprite frame.

    Note that this script sets a Visibility track keyframe for each mesh snapshot... this is for convenience (easier to play through and check the results)... sadly, Unity ignores Vis track...I've asked for it :)
     
    Last edited: Oct 4, 2011
    happymongo likes this.
  9. trimf

    trimf

    Joined:
    May 4, 2014
    Posts:
    6
  10. awsapps

    awsapps

    Joined:
    Jun 15, 2021
    Posts:
    74
    [9-2021] here is some example with finger detection: