So I have an object that´s being squeezed, changing its localScale in x from 1 to 2 and in y from 1 to 0.5. To achieve this in a realistic way in which movement between frames simmulates this constant area, each vertex moves in a curve to its final position.
Normally, the edge is constant and getting its equation is as simple as getting the cross product of (nextVertex - currentVertex) and the face´s normal. However, because the edge is inclined, its rotation changes along its path. I can´t upload the image, but is the case from above. The edge vector is from the bottom vertex to the top, always aligned at the x axis in this case (though that´s probably going to change), has also a constant depth axis and basically the only thing that changes is the height at both points, which is shown in the image. The edge changes because the top vertex has more depth than the bottom one (even if from this perspective looks like a perfect cube).
So the equation I thought would work was this: startEdgeNormal + (endEdgeNormal - startEdgeNormal) * t;
//Which is a lineal transition from start to end where “t” is the frame´s time, that goes from 0 to 1.
But it doesn´t work. I know this because I compared it with a fixed normal that I knew was right at t = 0.5f; However, because am going to use this equation to solve for other variables, I don´t know yet the value of t and therefore I can´t use that method.
When I compared both results, they were similar, but different enough to be considered != by an if statement. I know that comparing equal floats might not work because of their lack of precision; but when we are comparing vectors instead c# still considers very similar vectors equal.
So, is there a better way of getting the edge normal´s equation at time t?
I tried normalizing all vectors first and now even without doing that. Either way they differ.