谁能为傻瓜推荐一些Transformation Matrix教程? [英] Can anyone recommend some Transformation Matrix tutorials for dummies?

查看:61
本文介绍了谁能为傻瓜推荐一些Transformation Matrix教程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以为理解像我这样数学能力差的傻瓜的转换矩阵提供一些好的起点.

Can anyone recommend some good starting points for understanding Transformation Matrices for dummies like me with poor math skills.

我愿意学习数学,但我不是一个完全的白痴(我希望),但是我发现的示例似乎需要从我所知道的知识到我所需要知道的知识的巨大飞跃.

I'm willing to learn the math, and I'm not a complete idiot (I hope) but the examples I'm finding seem to require a huge leap from what I know, to what I need to know.

推荐答案

我编写了一个Web程序,可用于处理转换矩阵.它允许预设类型和自定义类型.

I wrote a web program that can be used to play around with transformation matrices. It allows preset types and custom ones.

在线玩使用数字应该很容易,并立即查看它如何影响房屋图纸.查看在线可用的代码来确定它在做什么,并且您应该能够了解正在发生的事情.

It should be easy to play with the numbers and instantly see how it affects the house drawing. Look at the code available online to determine what it's doing, and you should be able to understand what's going on.

如果遇到麻烦,请注意,只需将3×3矩阵乘以房屋形状中的每个顶点(X和Y坐标)即可.矩阵与顶点的乘积(我们现在将其称为向量)和变换矩阵看起来像这样……

If you're having trouble, realise that the 3×3 matrix is simply being multiplied by each vertex (X & Y coordinate) in the house shape. Matrix multiplication with the vertex (we will now refer to it as a vector) and a transformation matrix looks like so...

1 0 0   1
0 1 0 * 2
0 0 1   0

左侧是身份矩阵(不影响向量的幂等矩阵) )和1、2、0的向量(假设它映射到上述程序中X1和Y2的位置,而忽略最后的0).

On the left is an identity matrix (an idempotent matrix that doesn't affect the vector) and a vector of 1, 2, 0 (assume this maps to position X1 and Y2 in the program mentioned above's graph and ignore the final 0).

矩阵乘法可以像这样...

a b c   x   a * x + b * y + c * z
d e f + y = d * x + e * y + f * z
g h i   z   g * x + h * y + i * z

因此,在我们的示例中,应该是...

So, in our example, that would be...

1 0 0   1   1 * 1 + 0 * 2 + 0 * 0
0 1 0 * 2 = 0 * 1 + 1 * 2 + 0 * 0
0 0 1   0   0 * 1 + 0 * 2 + 1 * 0

做那个数学运算,我们得到最终的向量...

Do that math and we get the final vector...

1
2
0

由于我们说过我们的身份矩阵不应该修改值,所以我们可以在上面看到这种情况,因为结果向量与原始向量匹配.

Since we said our identity matrix shouldn't modify the values, we can see above that that is the case as the resulting vector matched the original.

要进一步解释,请考虑何时需要翻译载体.假设我们要沿X轴将房屋平移5像素.我们想从单位矩阵开始,但是将右上角的数字更改为5并在向量1中添加额外的维(您将简要了解为什么).

To explain further, consider when you need to translate the vector. Let's say we want to translate the house by 5 pixels along the X axis. We want to start with the identity matrix, but change the top right number to 5 and make the extra dimension in the vector 1 (you will see why briefly).

1 0 5   1   1 * 1 + 0 * 2 + 5 * 1 
0 1 0 * 2 = 0 * 1 + 1 * 2 + 0 * 1
0 0 1   1   0 * 1 + 0 * 2 + 1 * 1

我们再次进行数学运算...

We do the math again...

6
2
1

我们可以看到第一个数字(坐标中的X)已经由5沿X轴平移了.在上面链接的程序中尝试.

We can see that the first number (X in our coordinates) has been translated along the X axis by 5. Try it in the program linked above.

我们将第三个值设为1的原因是,当执行数学运算时,将考虑翻译.如果它是0,它将被忽略,因为任何数字乘以0都将导致0.

The reason we made the third value 1 is so when the math was performed, the translation was considered. Had it been 0, it will be ignored, as any number multiplied by 0 results in 0.

如果仍然遇到问题,请在线观看视频(这一个,例如)可以帮助以更直观的方式对其进行解释.

If you're still having trouble, check out videos online (this one, for example) which can help explain it in a more visual fashion.

请记住:尽管有人对数学缺乏自我评价,但几乎每个人都可以驾驶汽车,几乎每个人都可以学到这一点.只要坚持下去:持久性是关键.祝你好运.

Remember: pretty much anyone can drive a car, and pretty much anyone can learn this, despite any self-evaluated poor understanding of math. Just keep at it: persistence is key. Good luck.

这篇关于谁能为傻瓜推荐一些Transformation Matrix教程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆