当前位置:网站首页>[TA frost wolf \u may- hundred talents plan] 1.2.3 MVP matrix operation
[TA frost wolf \u may- hundred talents plan] 1.2.3 MVP matrix operation
2022-07-01 03:47:00 【zczplus】
【TA- Frost Wolf _may-《 Hundred people plan 》】1.2.2 Matrix computing
1.2.3 MVP Matrix computing
1.2.3.1 Learning goals
- take 3D The object is transformed into 2D Plane
- Prepare for the use of various spaces
1.2.3.2 MVP Definition of matrix
MVP The matrices are :
- Model Model
- View Observe
- Projection Projection
Five coordinates :
Vertex coordinates start in local space (Local Space), This is called local coordinates (Local Coordinate), It will then change to world coordinates (World Coordinate), Observation coordinate (View Coordinate), Cut coordinates (Clip Coordinate), And finally in screen coordinates (Screen Coordinate) The form ends .
1.2.3.3 M: Model space to world space
Model space takes itself as the origin , World space has an origin independent of the model itself .
There are three steps to transform from model space to world space ( The order cannot be changed ):
- The zoom
- rotate
- translation
The corresponding matrix transformation is carried out in turn to obtain the transformation matrix .
M Representation of matrix ( The rotation here only includes the rotation around y The rotation of the shaft , Do you need to add information about other axes ?):
1.2.3.4 V: From world space to visual space
Visual space : A space coordinate system centered on a camera .
From world space to camera space
↓
Pan the entire viewing space , Make the camera origin coincide with the elder martial sister's coordinate origin , And make the coordinate axes coincide
↓
The camera rotates first in world space , Retranslated
↓
In order to make the camera coincide with the world coordinates , Using inverse transformation
The transformation process :
- Pan the world space
- Rotate world space
- z The component is reversed ( The reason of left-handed coordinate system )
According to the above method, the transformation matrix is obtained by matrix transformation
V A matrix representation of a matrix :
1.2.3.5 P: Visual space to crop space
Be careful :
- Not a real projection , Prepare for projection
- Purpose : Determine whether the vertex is within the scope of the courseware
- P matrix : Yes x, y, z Scale the component , use w The component is the range value . If x,y,z It's all in range , Then the point is in the clipping space .
There are two ways of projection : - Perspective projection
- Orthographic projection
1.2.3.6 P: Perspective projection
P A matrix representation of a matrix :
The meaning of each parameter of perspective projection is shown in the figure below :
Use the above P matrix , The coordinates of the transformed visual cone are shown in the figure :
It can be obtained. , If a vertex is within the visual cone , Then its transformed coordinates must meet :x,y,z Both in -w To w Within the scope of .
1.2.3.7 P: Orthographic projection
Relevant schematic diagram of orthogonal projection and its parameter interpretation :
Orthographic projection P A matrix representation of a matrix :
summary
Model space 、 World space 、 The difference of visual field space :
- Model space is centered on the model itself , The origin of the coordinate axis is the origin of the coordinate , By scaling 、 rotate 、 translation **(Model matrix )** Set the model coordinates (Model Coordinate) Change to world coordinates (World Coordinate)
- World space is centered on the whole scene , By translation and rotation **(View matrix )**, as well as z The inverse of the component will set the world coordinates (World Coordinate) Convert to observation coordinates (View Coordinate)
- The visual field space takes the camera as the origin center , Through the projection matrix **(Projection matrix )** Observe the coordinates (View Coordinate) To crop coordinates (Clip Coordinate)
边栏推荐
- Valid brackets (force deduction 20)
- 小程序容器技术与物联网IoT的结合点
- Unexpected token o in JSON at position 1 ,JSON解析问题
- 访问阿里云存储的图片URL实现在网页直接预览略缩图而不直接下载
- 衡量两个向量相似度的方法:余弦相似度、pytorch 求余弦相似度:torch.nn.CosineSimilarity(dim=1, eps=1e-08)
- 30. Concatenate substrings of all words
- 谷粒学院微信扫码登录过程记录以及bug解决
- [EI conference] 2022 international joint civil and Offshore Engineering Conference (jccme 2022)
- 【TA-霜狼_may-《百人计划》】1.4 PC手机图形API介绍
- C语言的sem_t变量类型
猜你喜欢
[small sample segmentation] interpretation of the paper: prior guided feature enrichment network for fee shot segmentation
Are you still wasting brain cells for self-study? This interview note is definitely the ceiling of station C
RSN:Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs
pytorch nn.AdaptiveAvgPool2d(1)
Addition without addition, subtraction, multiplication and division
用小程序的技术优势发展产业互联网
Visit the image URL stored by Alibaba cloud to preview the thumbnail directly on the web page instead of downloading it directly
The combination of applet container technology and IOT
Random seed torch in deep learning manual_ seed(number)、torch. cuda. manual_ seed(number)
Unexpected token o in JSON at position 1 ,JSON解析问题
随机推荐
6. zigzag transformation
Leetcode:829. 连续整数求和
Sort linked list (merge sort)
bootsrap中的栅格系统
MFC窗口滚动条用法
Edlines: a real time line segment detector with a false detection control
The difference between MFC for static libraries and MFC for shared libraries
pytorch nn.AdaptiveAvgPool2d(1)
318. 最大单词长度乘积
409. 最长回文串
[nine day training] content III of the problem solution of leetcode question brushing Report
30. Concatenate substrings of all words
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
392. judgment subsequence
Asgnet paper and code interpretation 2
【TA-霜狼_may-《百人计划》】1.3纹理的秘密
[TA frost wolf \u may- hundred people plan] 1.3 secret of texture
静态库使用MFC和共享库使用MFC的区别
[small sample segmentation] interpretation of the paper: prior guided feature enrichment network for fee shot segmentation
[reach out to Party welfare] developer reload system sequence