Interpolation woes

tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
edited April 2013 in Working with GS (Mac)
It may be that I've stumbled across the already documented Interpolation issue with extremes (values near the "interpolate to" value), but here's the problem I'm having:

I am interpolating self.color.Alpha from 0.3 to 0.7 in game.Seconds seconds. If I change game.Seconds to 5, it reaches self.color.Alpha=0.7 in 3.7 seconds. Same issue? I've seen http://forums.gamesalad.com/discussion/54962/make-your-own-interpolations and may resort to it if I have to.

I thought I could work around this by having it Interpolate to 0.8 (or even 1) in 5 game.Seconds seconds but I'm not having much luck.

Best Answer

  • RThurmanRThurman Posts: 2,881
    Accepted Answer
    @tatiang -- I realize you figured out another way. But perhaps someone might find this useful. Its uses a standard formula for linear interpolation.

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    The actual implementation I'm working on is a 60 second interpolation of self.color.Alpha to fade in an actor. I need it to stop at 0.7 and then I change it to 1.0 to show that the actor/button is available again. But it's finishing in 47 seconds. Here's the demo with the 5 second example above.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    It looks like there's a factor of about 1.3333 difference between the attribute values (e.g. 60 seconds) and the stopping point (e.g. 47 seconds). I've tested it up to 5 minutes and 1.3333 seems about right. But I'm not confident that will work for larger/longer values.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    @socks is your man for the interpolation woes
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    I figured out another way to do this.
Sign In or Register to comment.