什么是仿射变换?
我正在阅读“Beginning Java Game Programming 2/e”,这本书非常强调使用 AffineTransform。
只有一个问题,它根本没有解释AffineTransform是什么、它做什么、以及AffineTransform的目的。
我已经做了一些谷歌搜索,但他们只是向我展示矩阵数学......有人能指出我正确的方向吗?
I'm reading "Beginning Java Game Programming 2/e" and the book heavily emphasizes using AffineTransform.
There is just one problem, it doesn't explain at all what it is, what it does, and the purpose of AffineTransform.
I have done some google searches, but they're just showing me matrix math... Could someone point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是因为仿射变换是矩阵数学。它是从一个图像到另一个图像的任何类型的映射,可以通过移动、缩放、旋转、反射和/或剪切图像来构建。 Java
AffineTransform
类允许您指定这些类型的转换,然后使用它们生成图像的修改版本。That's because an affine transform is matrix math. It's any kind of mapping from one image to another that you can construct by moving, scaling, rotating, reflecting, and/or shearing the image. The Java
AffineTransform
class lets you specify these kinds of transformations, then use them to produce modified versions of images.答案已经晚了好几年,但如果其他人正在为此苦苦挣扎,那么我建议阅读 Frank Luna 撰写的 DirectX 11 3D 游戏编程简介。这是一本非常好的书。虽然本书是关于 DirectX 11 的,但前三章仅介绍图形所需的数学概念。这些章节很好地解释了数学,并提供了大量练习来练习本章末尾的主题。 (你可能会玩 2D 游戏,但数学是相同的,向量和矩阵只是少了一维。)
Answer is years late, but if anyone else is struggling with this then I recommend reading Introduction to 3D Game Programming With DirectX 11 by Frank Luna. It is a very good book. Though book is about DirectX 11 the first three chapters are just about the math concepts needed for graphics. The chapters explains the math well and provided lots of exercises to practice the topics at the end of the chapter. (You may doing 2D games but the math is the same, the vectors and matrices have just one less dimension.)