Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a set of 3D points that I need to "blend" between. Lets say I have points [A,B,C] and I have the amount I want to blend each as [0.5, 0.2, 0.8], how can I blend between these points with the amount I need? I asked this previously and got an answer.

But, when all values are 0, I need to return to a Default point, so all blending must take effect as if deviating from the Default.

How do I calculate this? I'm sure its not just a weighted barycenter anymore?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Calculate the relative offset from Default to each point and add them on top of Default with the given weights. This means that you can't divide by the sum of the weights unlike in the previous answer you got.

deltaA = A - Default;
deltaB = B - Default;
deltaC = C - Default;
point = Default + deltaA * weightA + deltaB * weightB + deltaC * weightC;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.