Appendix D: Graphics matrix operations
Great Microprocessors of the Past and Present (V 13.4.0) (cpushack.com)
3-D points are generally stored in four element vectors, defined as:
[X, Y, Z, W]
...where X, Y, and Z are the point 3-D coordinates, and W is the 'weight', and is used to normalise the result after an operation, multiplying each element by 1/W so that W ends equal to 1.
Points can be moved around by matric multiplication with 4X4 transformation matrices. Multiplying a vector with a matric produces a new vector, which is the transformed point. Standard transformation matrices are:
Identity (does not transform point): [ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ] Translate (move along X, Y, Z axes): [ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ] [ Tx Ty Tz 1 ] Scale (translate to larger or smaller coordinates): [ Sx 0 0 0 ] [ 0 Sy 0 0 ] [ 0 0 Sz 0 ] [ 0 0 0 1 ] Rotate (around X, Y, or Z axis by angle U): Axis X: Axis Y: Axix Z: [ 1 0 0 0 ] [cosU 0 -sinU 0 ] [cosU sinU 0 0 ] [ 0 cosU sinU 0 ] [ 0 1 0 0 ] [-sinU cosU 0 0 ] [ 0-sinU cosU 0 ] [sinU 0 cosU 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ] [ 0 0 0 1 ] [ 0 0 0 1 ] Perspective (d is the distance of "eye" behind "screen"): [ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ] [ 0 0 1/d 0 ]
Transformation matrices can be combined by multiplying them together, so a single matrix can be use to shift, rotate, and scale a point in a single operation. Other 3-D operations using vectors are also frequently used, such as to determine intersection points or the reflection of light rays.
六级/考研单词: coordinate, norm, translate, axis, rotate, seldom, junction, ray
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?