1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Simple Math question

Discussion in 'Programming' started by Halph-Price, Dec 22, 2017.

  1. Halph-Price

    Halph-Price Member

    Joined:
    Mar 20, 2017
    Posts:
    42
    Any tip or tutorials for doing exp/log.

    I get the programming but it's been a while since I did math.

    example: To make alpha fade away on smoke, there's linear way of just "image_alpha-=.01"

    but to make it fade away in the same time, but quickly in the start and then slower towards the end, or vice versa, what's the particular formula for something like that.

    I've been messing around but I can't seem to really notice the differences, and I am not sure what I am doing.

    I am sure there's someone here that knows math. I could figure out the answers to problems, but I don't even know how to write the problem from scratch.
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,603
    Have a variable t vary linearly in the [0, 1] range, then use any fast-start-slow-end function to set image_alpha, e.g. sqrt(t) or sin(t*pi/2).

    Help yourself and study up on Robert Penner's tweening equations.
     
  3. Halph-Price

    Halph-Price Member

    Joined:
    Mar 20, 2017
    Posts:
    42
    That's exactly what I wanted. It's not like it's an easily googleable question. Thanks for the tip using sqrt(t) or sin(t*pi/2) I wouldn't even think of it. That's great.

    That's a great link.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice