Talk:Mathematics of glTexGen: Difference between revisions
Created page with 'Don't know if this is the right place for writing this, but I was just applying the maths mentioned in the article, and I think the GL_SPHERE_MAP calculations are not correct, fo…' |
No edit summary |
||
Line 1: | Line 1: | ||
Don't know if this is the right place for writing this, but I was just applying the maths mentioned in the article, and I | Don't know if this is the right place for writing this, but I was just applying the maths mentioned in the article for a project I was working on, and I found out the GL_SPHERE_MAP calculations are not correct, for where it says: | ||
'''reflectionVector = myEyeVertex - myEyeNormal * 2.0 * dot3D(myEyeNormal, myEyeNormal);''' | '''reflectionVector = myEyeVertex - myEyeNormal * 2.0 * dot3D(myEyeNormal, myEyeNormal);''' | ||
Line 15: | Line 15: | ||
'''m = 1.0 / ( 2.0 * sqrt(dot3D(reflectionVector, reflectionVector)) );''' | '''m = 1.0 / ( 2.0 * sqrt(dot3D(reflectionVector, reflectionVector)) );''' | ||
I'm not | I'm not an expert on the subject, but having checked the OpenGL reference pages and looking carefully at the glTexGen documentation, it seems the original formula posted on this page was not correct. | ||
Revision as of 23:04, 14 November 2010
Don't know if this is the right place for writing this, but I was just applying the maths mentioned in the article for a project I was working on, and I found out the GL_SPHERE_MAP calculations are not correct, for where it says:
reflectionVector = myEyeVertex - myEyeNormal * 2.0 * dot3D(myEyeNormal, myEyeNormal);
It should be:
reflectionVector = myEyeVertex - myEyeNormal * 2.0 * dot3D(myEyeVertex, myEyeNormal);
And where it says:
m = 1.0 / 2.0 * sqrt(dot3D(reflectionVector, reflectionVector));
It should be:
m = 1.0 / ( 2.0 * sqrt(dot3D(reflectionVector, reflectionVector)) );
I'm not an expert on the subject, but having checked the OpenGL reference pages and looking carefully at the glTexGen documentation, it seems the original formula posted on this page was not correct.