变换矩阵TransformationMatrix
参考
- https://blog.csdn.net/u014587123/article/details/80337627?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1
https://blog.csdn.net/xyh930929/article/details/83715368
空间坐标系
:::info
局部空间LocalSpace=物体空间ObjectSpace-物体坐标系(ObjectCoordinates)
- 世界空间WorldSpace-世界坐标系WorldCoordinates
- 观察空间ViewSpace=视觉空间EyeSpace-人眼坐标系EyeCoordinates
- 裁剪空间ClipSpace-裁剪坐标ClipCoordinates
- 标准化设备坐标NormalizedDeviceCoordinatesNDChttps://blog.csdn.net/CALL_LKC/article/details/81411034?utm_source=blogxgwz1
窗口=屏幕空间ScreenSpace窗口屏幕坐标WindowCoordinates=ScreenCoordinates :::
矩阵
glMatrixMode()选择当前操作矩阵模式
- glLoad*();加载矩阵
- glPushMatrix ();glPopMatrix ();矩阵堆栈
获取矩阵glGetFloat
float mat[16];
glGetFloatv(GL_MODELVIEW_MATRIX, mat);
for (int i = 0; i < 16; i++)
{
printf("%f ", mat[i]);
if ((i+1) % 4 == 0)
{
printf("\n");
}
}
模型变换ModelTransformation
glTranslate*();``glScaled;``glRotated;
坐标 :::info
模型变换矩阵ModelMatrix
旋转矩阵 ::: 矩阵推导https://www.cnblogs.com/WangGuiHandsome/p/10094784.html
视点变换
gluLookAt;
- 坐标
-
投影变换
glOrtho();``glFrustum();gluPerspective();
- 投影矩阵PROJECTIONMatrix
-
透视投影-近大远小正交投影