   Smooth transition from one value to another
  Hi all!I currently have a function that generates a random 3D array value (x,y,z) and also a function that takes that value and render a mesh according to the values.The function is called whenever I press space bar. Now instead of the abrupt change from one mesh to another, I wonder if there is anyway I can smoothly transition the change?Something like:Generate array, save this valueGenerate array again, save the second valueCalculate the values it takes to render from first to second valueRender each of those values out every frameSo I would have something like (x1, y1, z1) and (x2, y2, z2) (1 = start and 2 = final). How do I generate (and render) the points in between so it has a smooth transition instead of just jumping from x1 -> x2 etc,Thanks for any help offered.   
  Look out for "linear interpolation" and apply that for each pair (x1,x2), (y1,y2), and (z1,z2) separately.   ;  Simple linear interpolation would probably be a good starting point. Given two values a and b and a parametric value t, you can compute the interpolated value as follows:value = (1-t)a+tbWhen t is zero, the first value (a) is returned; when t is one, the second value (b) is returned. To interpolate between two vectors, you would apply the above equation on a per-element basis.This approach isn't suitable in all situations, and for those situations there are more sophisticated interpolation methods available. Again though, it should be a good starting point.   ;  Thanks for the answers! Will have  a look at linear interpolation.;Quote:Original post by jykSimple linear interpolation would probably be a good starting point. Given two values a and b and a parametric value t, you can compute the interpolated value as follows:value = (1-t)a+tbWhen t is zero, the first value (a) is returned; when t is one, the second value (b) is returned. To interpolate between two vectors, you would apply the above equation on a per-element basis.This approach isn't suitable in all situations, and for those situations there are more sophisticated interpolation methods available. Again though, it should be a good starting point.Hmm don't quite get the parametric part. What if t = 0.5? value returned is the mid-point value of the interpolation? So to interpolate from a to b I should set t from 0 to 1 over time?;Quote:Hmm don't quite get the parametric part. What if t = 0.5? value returned is the mid-point value of the interpolation? So to interpolate from a to b I should set t from 0 to 1 over time?Yes.   