- 3
- 0
- 约1.43万字
- 约 12页
- 2019-12-23 发布于湖北
- 举报
常用数学矩阵Author: Jack Hoxley
Contents of this lesson1. Introduction2. 2D Transformations3. 3D Transformations
1. Introduction 介绍
?? 矩阵转换通常就是三种东西-旋转,缩放,平移。在3d graphics中帮你完成 99%的工作,我未见到比他更快的方法。矩阵使程序加速,也许每秒多渲染500个对象。
Transformation consists of 3 things - rotating (spinning things around), scaling (making things bigger/smaller) and translation (moving things around). With 3D graphics Direct3D will do 99% of the work for you, however, along my travels Ive found a way of going faster - if you do the matrix maths calculations yourself you can go just that little bit faster (2.5x faster), were talking the difference between 0.0001ms and 0.00005ms here, but if youre rendering 500+ objects a frame (several 1000 a second), it could be worth the extra effort. It also looks much cleverer! (if you open-source your code).
Onwards and upwards...
2. 2D Transformations 两维转换
? 它在2D,3D游戏中都很有用,数学方法这里不多解释。This is the most useful part, using either DirectDraw (fully 2D) or Direct3D (quasi 2D) no transformations are done for you - you want to rotate, translate or scale something youre gonna have to do it yourself. The actual mathematical proof behind all of this is a little complicated, and to be honest - it really makes much difference why it works, all we want to know is how to make it work for us. Much of the pure maths is glossed over here, if youre interested in proofs or further explanations dig out your old maths books or go searching the web - much of the pure maths is too lengthy to explain here.
我们不用知道它是任何推导的,仅使用它。Were going to be using a mathematical technique known as matrix maths - the ideas behind matrices (plural of matrix) isnt too important, heck! I dont even know exactly how to use them - I just learnt what I need to know about them. Matrix maths allows us to do the transformations relatively quickly, and relatively simply as well - just what I like.
基本的结构向这样[X,Y] -- [M] -- [X,Y]一个x,y坐标进去经过变化出来一个新坐标,可能是缩放、旋转也可能是平移。The basic structure is like this [X,Y] ---} [M]
原创力文档

文档评论(0)