Blending between 3 Vecs by one Flt Author Message
Chris
Member

 Post: #1 Blending between 3 Vecs by one Flt Hi, Before me trying to explain my problem, here's a picture:     Input: I have a Flt a = 0..1; I have three Vec p, v, and x and I have a Flt threshold such as 0.1f Desired output: I want a new Vec which is smoothly blended (it'd be good for both cubic and linear solutions) between p and v, when lower than threshold, or smoothly blended between v and x, when a is higher than threshold. I can't have any more "weights" other than a. Looking for correctness. 1. Is this just a simple case of if statements from a < threshold, then individual lerps to each one? If so, can LerpCube be applied component-wise to xyz to get the desired behaviour correctly? 2. Is there a more elegant way to do this, i'm very interested! 3. Is there a mathematical name for doing this optimally, like "offset cubic equation" etc? Thanks for your help, Chris (This post was last modified: 04-13-2011 06:22 PM by Chris.)
04-13-2011 06:00 PM
Esenthel
 Post: #2 RE: Blending between 3 Vecs by one Flt you will get smooth result only when using EE::Lerp4 (but that needs 4 values, and you have 3) I think there is on internet a smooth lerp that uses 3 values (search for "catmull-rom" in google for 3 values) once you have the Lerp3 function you can do: Code: ```if(a