Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › 作业7求模型矩阵问题? This topic has 0 replies, 1 voice, and was last updated 3 years, 4 months ago by hide on bush. Viewing 0 reply threads Author Posts 2021年8月3日 at 上午11:30 #9008 Score: 0 hide on bushParticipant 有没有大佬帮忙解释一下: 为什么一个点的模型矩阵可以这样计算? 并且为什么计算出来的C向量一定是上向量? Vector3f toWorld(const Vector3f &a, const Vector3f &N){ Vector3f B, C; if (std::fabs(N.x) > std::fabs(N.y)){ float invLen = 1.0f / std::sqrt(N.x * N.x + N.z * N.z); C = Vector3f(N.z * invLen, 0.0f, -N.x *invLen); } else { float invLen = 1.0f / std::sqrt(N.y * N.y + N.z * N.z); C = Vector3f(0.0f, N.z * invLen, -N.y *invLen); } B = crossProduct(C, N); return a.x * B + a.y * C + a.z * N; } Author Posts Viewing 0 reply threads You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In