На следующем сайте предлагается использовать матрицу model_view при вычислении матрицы нормалей (при условии, что мы не используем встроенную gl_NormalMatrix): (site)Маяк. У меня есть следующий алгоритм в моей программе:
//Calculate Normal matrix
// 1. Multiply the model matrix by the view matrix and then grab the upper left
// corner 3 x 3 matrix.
mat3x3 mv_orientation = glext::orientation_matrix<float, glext::column>(
glext::model_view<float, glext::column>(glext_model_, glext_view_));
// 2. Because openGL matrices use homogeneous coordinate an affine inversion
// should work???
mv_orientation.affine_invert();
// 3. The normal matrix is defined as the transpose of the inverse of the upper
// left 3 X 3 matrix
mv_orientation.transpose();
// 4. Place this into the shader
basic_shader_.set_uniform_3d_matrix("normal_matrix", mv_orientation.to_gl_matrix());
Предполагая, что большинство приведенных выше утверждений верны в вышеупомянутом коде. Разве вы не включаете матрицу проекции в вычисление нормальной матрицы? Если нет, то почему матрица проекции не влияет на нормали, как на точки?