2D几何对象的转换
我正在尝试构建一个您可以做的应用程序,您可以旋转,缩放,拉伸和翻译像下面的图像中的几何形状,我知道我应该使用Matrix4,并且我正在尝试使用某些软件包,例如 matrix4_transform and matrix_gesture_detector ,但我不知道Matrix4值确切地效应形状,旋转和翻译。任何文档或解释,我都会
感谢href =“ https://i.sstatic.net/6ez6b.gif” rel =“ nofollow noreferrer”>
I'm trying to build an app that you can do Rotation, scale, stretch and translates a geometric shape like the image below in flutter, I know that I should use matrix4 and I'm trying to use some packages like matrix4_transform and matrix_gesture_detector but I don't know how exactly the matrix4 values effect the shape's Scale,Rotate and Translate .if there is any documentation or explaine i would appreciate
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
具有代表3D转换的4x4矩阵可能有点违反直觉。
从理论上讲,此 4x4 矩阵代表 3D 投影空间中的线性变换。长话短说,这是一种“数学黑客”,可以表示比例/旋转/剪切和翻译为单个矩阵。
这大大简化了进一步的计算,因为结合任何两个转换只是繁殖4x4矩阵。
如果您对更多感兴趣,则可以轻松地在线找到很多信息,因为这种方法几乎全部用于所有计算机图形。
简介简介。
但是,您实际上不需要确切地知道如何构建或计算不同转换的矩阵。 flutter's
matrix4 你需要。
Having a 4x4 matrix to represent a 3D transformation may be a bit counterintuitive.
Theoretically speaking, this 4x4 matrix represents a linear transformation in 3d projective space. Long story short, it's a kind of "mathematical hack" that allows to represent scale/rotation/shear and translation as a single matrix.
This greatly simplifies further calculations, as combining any two transformations is just multiplying 4x4 matrices.
If you're interested in more, you can easily find a lot of info online, since this approach is widely used in pretty much all of computer graphics.
Brief introduction.
But, you don't really need to know exactly how to build or calculate matrices for different transformations. Flutter's
Matrix4
class has all the utilities you need.