Friday, May 12, 2017

Linear interpolation - Lerp

Lerp is very powerful.
Linear interpolation works on values , point, any pair of list as long as they have same length and substructure. Bias usually goes between 0-1. Bias outside that will extrapolate to corresponding values  along the Linear interpolation line. For example you can lerp between two sets of polyhedra points. Combined with Smooth Curve very interesting effects can be achieved. Sometimes Lerp is called mix.

Usage:


my_point=lerp( [x,y] , [5,1] , 0.30 );

function lerp(start, end, bias) = (end * bias + start * (1 - bias));


No comments:

Post a Comment