次のサイトでは、法線行列を計算するときに model_view 行列を使用するように指示されています (組み込みの gl_NormalMatrix を使用していないと仮定します): (site) Light House . 私のプログラムには次のアルゴリズムがあります。
//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());
上記のほとんどのステートメントが前述のコードで正しいと仮定します。正規行列の計算に射影行列を含めませんか? そうでない場合、射影行列は法線に影響を与えませんか?