当前位置:网站首页>Simple mathematical knowledge related to 3D
Simple mathematical knowledge related to 3D
2022-07-27 15:14:00 【A fool is a little proud】
Three dimensional coordinate system :
Modules of vectors : The distance from the start of the vector to the end
FLOAT D3DXVec3Length( // Returns the magnitude.
CONST D3DXVECTOR3* pV // The vector to compute the length of.
);
Vector normalization ( Normalization ) Scale the length of the vector to 1
D3DXVECTOR3 *D3DXVec3Normalize(
D3DXVECTOR3* pOut, // Result.
CONST D3DXVECTOR3* pV // The vector to normalize.
);
Vector addition and subtraction :
D3DXVECTOR3 u(2.0f, 0.0f, 1.0f);
D3DXVECTOR3 v(0.0f, -1.0f, 5.0f);
D3DXVECTOR3 sum = u + (-) v; // = (2.0f, -1.0f, 6.0f)
D3 Product of scalar and vector :
D3DXVECTOR3 u(1.0f, 1.0f, -1.0f);
D3DXVECTOR3 scaledVec = u * 10.0f;
Dot product ( The result is scalar ):
u · v =|u||v|cosθ
adopt u*v Judge the angle between two vectors ,0 vertical ,<0 Greater than 90 degree ,>0 Less than 90 degree
float dot = D3DXVec3Dot( &u, &v );
Cross product ( The result is another vector ):
The length is the modulus of two vectors multiplied by the sine of the included angle , In any coordinate system, use the rule of any coordinate system to judge the direction of cross product .
Direction : Point to the second vector according to the first vector
D3DXVec3Cross
Matrix multiplication :
Inverse matrix :
Only a square matrix has an inverse matrix , And not necessarily
p’= pR And suppose we know p’ and R Sure seek p
D3DMatrixIverse
Transposition :
D3DMatrixTranspose
Geometric transformation :
Homogeneous coordinates ( use n+1 Dimensional coordinates to represent n Dimensional coordinates ):
3*3 The transformation matrix of has certain limitations , Basic set transformations such as translation perspective projection cannot be completed , Therefore, it is necessary to expand the coordinates of three-dimensional points and vectors to 4 Homogeneous coordinates of dimensions
Homogeneous coordinates of points :(x,y,z,1)
Homogeneous coordinates of vectors :(x,y,z,0)w The value is 0 It can ensure that the vector is not affected by the translation transformation , So for points and vectors in the same graph , There is no need to distinguish them , Just use a transformation matrix to perform geometric transformation
Translation transformation matrix :
D3DXMATRIX *D3DXMatrixTranslation(
D3DXMATRIX* pOut, // Returns the translated matrix .
FLOAT x, // x Unit of axis movement
FLOAT y, // y Unit of axis movement
FLOAT z // z Unit of axis movement
);
The zoom :
D3DXMATRIX *D3DXMatrixScaling(
D3DXMATRIX* pOut, // Returns the scaled matrix
FLOAT sx, // x Scale of axis scaling
FLOAT sy, // y Scale of axis scaling
FLOAT sz // z Scale of axis scaling .
);
rotate :
D3DXMATRIX *D3DXMatrixRotationX(
D3DXMATRIX* pOut, // Returns the rotated matrix
FLOAT Angle // Angle Is the arc of rotation
);
边栏推荐
- HDU3117 Fibonacci Numbers【数学】
- Visual system design example (Halcon WinForm) -9. text display
- 一些二进制位操作
- 周鸿祎:数字安全能力落后也会挨打
- LeetCode 81. 搜索旋转排序数组 II 二分/medium
- USB接口电磁兼容(EMC)解决方案
- adb命令 (安装apk包格式:adb install 电脑上apk地址包名)
- NEFU118 n!后面有多少个0【算术基本定理】
- See "sense of security" in uncertainty Volvo asked in 2022
- Unity性能优化------DrawCall
猜你喜欢

Idea makes jar packages and introduces jar packages

4种单片机驱动继电器方案

仅做两项修改,苹果就让StyleGANv2获得了3D生成能力

Graphical SQL is too vivid

DIY ultra detailed tutorial on making oscilloscope: (1) I'm not trying to make an oscilloscope

积分运算电路的设计方法详细介绍

Introduction of the connecting circuit between ad7606 and stm32

Code coverage statistical artifact -jacobo tool practice
USB接口电磁兼容(EMC)解决方案

周鸿祎:数字安全能力落后也会挨打
随机推荐
2022-07-27日报:IJCAI 2022杰出论文公布,大陆作者中稿298篇拿下两项第一
LeetCode 面试题 17.21. 直方图的水量 双指针,单调栈/hard
《剑指Offer》 合并两个排序的链表
NEFU119 组合素数【算术基本定理】
网络设备硬核技术内幕 路由器篇 14 从鹿由器到路由器 (中)
See "sense of security" in uncertainty Volvo asked in 2022
LeetCode 190. 颠倒二进制位 位运算/easy
LeetCode 74. 搜索二维矩阵 二分/medium
If we were the developer responsible for repairing the collapse of station B that night
LeetCode 240. 搜索二维矩阵 II medium
谷歌团队推出新Transformer,优化全景分割方案|CVPR 2022
LeetCode 456. 132模式 单调栈/medium
网络设备硬核技术内幕 路由器篇 17 DPDK及其前传(二)
Passive income: return to the original and safe two ways to earn
多线程环境下CountDownLatch的用法
Notice of Nanshan District Civil Affairs Bureau on carrying out the grade evaluation of social organizations in Nanshan District in 2022
ADB command (install APK package format: ADB install APK address package name on the computer)
Stm32f103c8t6 drives sh1106 1.3 "IIC OLED display under Arduino frame
STM32F103C8T6在Arduino框架下驱动ssd1306 0.96“ IIC OLED显示
网络设备硬核技术内幕 路由器篇 7 汤普金森漫游网络世界(下)