私はOpenGLを初めて使用し、参照やチュートリアルを読むときに、これらすべてが既知のメカニズムとして行列を使用するため、誰かが抽象的な直感的な方法で私を説明できれば、行列を何に使用するのか疑問に思っていました. 私は数学で行列を学びましたが、英語が私の母国語ではないため、意味を理解するのが難しいものがあります。
www.learnopengl.com で良い例を見つけました。
The model matrix. This matrix is used to place a model somewhere in the “world”. For example, if you have a model of a car and you want it located 1000 meters to the east, you will use the model matrix to do this.
The view matrix. This matrix represents the camera. If we want to view our car which is 1000 meters to the east, we’ll have to move ourselves 1000 meters to the east as well (another way of thinking about it is that we remain stationary, and the rest of the world moves 1000 meters to the west). We use the view matrix to do this.
The projection matrix. Since our screens are flat, we need to do a final transformation to “project” our view onto our screen and get that nice 3D perspective. This is what the projection matrix is used for.
これはそれをかなりよく説明しています。しかし、どうやってそれらを構築するのでしょうか? それらはどのくらいの大きさですか?
また、私はこの質問を読みました: OpenGL で glLoadIdentity() は何をしますか?
それ:
glMatrixMode(GL_PROJECTION) は、透視変換または直交変換で使用される行列を扱います。
glMatrixMode(GL_MODELVIEW) は、モデル ビュー変換で使用される行列を処理します。つまり、オブジェクト (別名モデル) をビュー座標空間 (またはカメラ空間) に変換します。
これらの変換は何を意味し、どのように計算されるのでしょうか?
ここに多くの質問があることはわかっていますが、OpenGL をよりよく理解するために、これらすべての概念をよりよく理解しようとしています。そのため、概念を超えた概念を理解してすべての詳細に飛び込むために、抽象的な説明が必要です。