A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Grape Animation Library

  1. #1
    Senior Member
    Join Date
    May 2006
    Location
    Manhattan
    Posts
    246

    Grape Animation Library

    I always end up writing my own animations for game stuff because it's just more complex than simple point to point tweens. So I wrote a library that adds the path you animate along to the equation. Interested in your thoughts!

    post on my blog: http://blog.generalrelativity.org/ac...ation-library/
    demo: http://lab.generalrelativity.org/animation/
    project: http://code.google.com/p/grape-as3/

  2. #2
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    That looks pretty cool, nice job!

    The API seems to look pretty straightforward and clean, which is nice.

    Not that is is necessarily needed(or I would even use), but how hard do you think it would be to make another linear setting to have a constant speed for a curve rather than having the speed vary(as I assume the time variable or the equivalent is linearly increasing, but not necessarily the speed). I think it would "just" require some sort of transformation on the time function, though finding that transformation function may be difficult.

    My point is merely just to think about it, not necessarily that it should be done.

  3. #3
    Senior Member
    Join Date
    May 2006
    Location
    Manhattan
    Posts
    246
    it's actually in the library already for beziers! if you read the section in my blog post about quad and cubic beziers i talk a little about it.

    i hadn't considered it, because beziers are the real trouble-makers in this department, but the solution does apply generally to curves, so maybe i will add it. it requires finding the derivative which is a bit of code to tack on to every curve.

    thanks for the point and for checking it out!

  4. #4
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    Oops, my bad for not noticing that, that's what I get for skimming.

    Does that mean you have functionality(at least under the hood), to take any speed function and map it to a bezier, and not just a constant function? (Though you may have to normalize the speed function)

  5. #5
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    Does it rotate the clip around the center of bezier, as TweenMax does?
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  6. #6
    Senior Member
    Join Date
    May 2006
    Location
    Manhattan
    Posts
    246
    @UnknownGuy: it re-parametrizes the curve by arc length. basically you have a value between 0 and 1 where 0 is the curve's start point and 1 is its end point. 0.5 won't necessarily be at the center, spatially. the goal is to parametrize it so that that new value represents the spatially expected value.

    @ImprisonedPride: no. it doesn't make any assumptions like that. wouldn't be too hard to add a heading flag or something.

  7. #7
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    Ok, that makes sense. Makes it pretty flexible then indeed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center