Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to LERP()

Pete Karl II
September 12, 2016

Introduction to LERP()

This was one of a weekly series I did on technical topics. This 5-minute introduction to linear interpolation was meant to show how code could feel natural.

Pete Karl II

September 12, 2016
Tweet

More Decks by Pete Karl II

Other Decks in Education

Transcript

  1. 146.2 1701.68 lerp(146.2, 1702.68, 0.5) = 924.44 LERP(start, stop, amount)

    lerp(146.2, 1702.68, 0.3) = 613.144 lerp(146.2, 1702.68, 0.75) = 1313.56
  2. 0.0 1000.0 lerp( 0.0, 1000.0, Math.sin(time) ) Math.sin() given radians,

    returns sine value *note - Math.sin(time) formula simplified for effect
  3. Want to learn more about LERP() and how to code

    animations? https://thebookofshaders.com https://www.youtube.com/user/shiffman