当前位置:网站首页>【TA-霜狼_may-《百人计划》】1.2.3 MVP矩阵运算
【TA-霜狼_may-《百人计划》】1.2.3 MVP矩阵运算
2022-07-01 03:24:00 【zczplus】
【TA-霜狼_may-《百人计划》】1.2.2 矩阵计算
1.2.3 MVP矩阵计算
1.2.3.1 学习目的
- 将3D物体转化到2D平面
- 为各个空间的运用做准备
1.2.3.2 MVP矩阵的定义
MVP矩阵分别是:
- Model 模型
- View 观察
- Projection 投影
五个坐标:
顶点坐标起始于局部空间(Local Space),这里称为局部坐标(Local Coordinate),它再之后会变为世界坐标(World Coordinate),观察坐标(View Coordinate),裁剪坐标(Clip Coordinate),并最终以屏幕坐标(Screen Coordinate)的形式结束。
1.2.3.3 M:模型空间到世界空间
模型空间以自身为原点,世界空间有独立于模型本身的原点。
从模型空间变换到世界空间分为三个步骤(顺序不能变换):
- 缩放
- 旋转
- 平移
对应的依次进行矩阵变换得出变换矩阵。
M矩阵的表示(这里的旋转只包含了围绕y轴的旋转,是否需要添加有关其他轴的呢?):
1.2.3.4 V: 世界空间到视觉空间
视觉空间:以摄像机为中心的空间坐标系。
从世界空间变换到摄像机空间
↓
平移整个观察空间,使得摄像机原点和师姐坐标原点重合,并使得坐标轴重合
↓
摄像机在世界空间中是先旋转,再平移的
↓
为了让摄像机与世界坐标重合,采用逆变换
变换过程:
- 对世界空间平移
- 对世界空间进行旋转
- z分量取反(左手坐标系的缘故)
按照上述方法依次进行矩阵变换得出变换矩阵
V矩阵的矩阵表示:
1.2.3.5 P: 视觉空间到裁剪空间
注意:
- 不是真正的投影,为投影做准备
- 目的:判断顶点是否在课件范围内
- P矩阵:对x, y, z分量进行缩放,用w分量做范围值。如果x,y,z都在范围内,那么该点在裁剪空间内。
有两种投影方式: - 透视投影
- 正交投影
1.2.3.6 P:透视投影
P矩阵的矩阵表示:
透视投影各个参数的意义如下图:

利用上述P矩阵,得到的变换后的视锥体坐标如图:
由此可得,如果一个顶点在视锥体之内,那么它变换后的坐标必须满足:x,y,z均在-w到w的范围内。
1.2.3.7 P:正交投影
正交投影的相关示意图及其参数解释:
正交投影P矩阵的矩阵表示:
总结
模型空间、世界空间、视野空间的区别:
- 模型空间以模型自身为中心,坐标轴原点为坐标原点,通过缩放、旋转、平移**(Model矩阵)**将模型坐标(Model Coordinate)变换到世界坐标(World Coordinate)
- 世界空间是以整个场景作为中心,通过平移和旋转**(View 矩阵)**,以及z分量的取反将世界坐标(World Coordinate)转换到观察坐标(View Coordinate)
- 视野空间以摄像机作为原点中心,通过投影矩阵**(Projection 矩阵)**可将观察坐标(View Coordinate)转换到裁剪坐标(Clip Coordinate)
边栏推荐
- 【JPCS出版】2022年第三届控制理论与应用国际会议(ICoCTA 2022)
- 在 C 中声明函数之前调用函数会发生什么?
- 205. isomorphic string
- [TA frost wolf \u may- hundred people plan] 2.4 traditional empirical lighting model
- 8. string conversion integer (ATOI)
- Promql select time series
- Valentine's Day is nothing.
- Implement pow (x, n) function
- Golang multi graph generation gif
- Processing of menu buttons on the left and contents on the right of the background system page, and double scrolling appears on the background system page
猜你喜欢

Blueprism registration, download and install -rpa Chapter 1

Appium自动化测试基础 — APPium基本原理

Cygwin的下载和安装配置

pytorch训练深度学习网络设置cuda指定的GPU可见
![[TA frost wolf \u may- hundred people plan] 2.3 introduction to common functions](/img/be/325f78dee744138a865c13d2c20475.png)
[TA frost wolf \u may- hundred people plan] 2.3 introduction to common functions
![[nine day training] content III of the problem solution of leetcode question brushing Report](/img/7e/1e76181e56ef7feb083f9662df71c7.jpg)
[nine day training] content III of the problem solution of leetcode question brushing Report

谷粒学院微信扫码登录过程记录以及bug解决

Bilinear upsampling and f.upsample in pytorch_ bilinear

The difference between MFC for static libraries and MFC for shared libraries

LeetCode 31下一个排列、LeetCode 64最小路径和、LeetCode 62不同路径、LeetCode 78子集、LeetCode 33搜索旋转排序数组(修改二分法)
随机推荐
Cookie&Session
165. 比较版本号
The combination of applet container technology and IOT
Asgnet paper and code interpretation 2
6. Z 字形变换
208. 实现 Trie (前缀树)
242. 有效的字母异位词
Thread data sharing and security -threadlocal
205. 同构字符串
Edge drawing: a combined real-time edge and segment detector
Feature pyramid networks for object detection
C语言的sem_t变量类型
Test function in pychram
后台系统右边内容如何出现滚动条和解决双滚动条的问题
168. excel table column name
5. [WebGIS practice] software operation - service release and permission management
Pathmeasure implements loading animation
The preorder traversal of leetcode 144 binary tree and the expansion of leetcode 114 binary tree into a linked list
166. fractions to decimals
torch. histc