As the title says I have been trying to understand the normal interpolation for the Phong shading/lighting model. I am unsure of the equation to calculate the normal but I have come across this equation:
N=Na*α+Nb(1−α)
Where N is the interpolated vector, Na and Nb are unit vectors to interpolate between and I'm assuming α is the percentage between the two. However in using this model as shown here:
public static Vector3 lerp(Vector3 a, Vector3 b, double alpha){
return (a.multiply(alpha)).add(b.multiply(1-alpha)).normalize();
}
I am not obtaining the correct results, so any advice on the topic, such as what I may be doing wrong etc, would be appreciated.
EDIT: I found my mistake in the interpolation, here is the updated method for those who are interested:
public static Vector3 lerp(Vector3 a, Vector3 b, double gradient){
return a.add((b.minus(a)).multiply(gradient));
}