变换缩放似乎不起作用
我正在实现一个列主变换矩阵,看起来像这样:
|----------| |------------| |------------|
| 0 3 6 9 | | RS R R X | | RS R R X |
| 1 4 7 10 | | R RS R Y | | R RS R Y |
| 2 5 8 11 | | R R RS Z | | R R RS Z |
|----------| |------------| | 0 0 0 1 |
|------------|
我知道缩放应该应用于位置 0、4 和 8,但它似乎不起作用。我从四元数设置方向,设置适当的位置,然后尝试将缩放乘以位置 0、4 和 8。当将此变换输入 OpenGL 时,我的形状会拉伸和挤压,并且不会适当缩放。我在这里错过了什么吗,我认为缩放是沿对角线的简单乘法?我的方向应用程序相对简单,但添加缩放操作会导致奇怪的剪切和挤压效果。我做错了什么?
I am implementing a column-major transformation matrix that looks something like this:
|----------| |------------| |------------|
| 0 3 6 9 | | RS R R X | | RS R R X |
| 1 4 7 10 | | R RS R Y | | R RS R Y |
| 2 5 8 11 | | R R RS Z | | R R RS Z |
|----------| |------------| | 0 0 0 1 |
|------------|
I understand that scaling is supposed to be applied to positions 0, 4, and 8, but it doesn't seem to work. I set the orientation from a quaternion, set the position as appropriate, and then attempt to multiply in my scaling to positions 0, 4, and 8. When this transform is fed into OpenGL, my shapes stretch and squash and do not scale appropriately. Am I missing something here, I thought scaling was a simple multiplication along the diagonals? My orientation application is relatively straightforward, but adding the scaling operation to it results in strange sheering and squashing effects. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想到的缩放矩阵仅适用于仅缩放或将其乘以已存在的转换。一旦基础变换不是同一性,销售因素就适用于整个左上 3x3。只计算乘法
The scaling matrix you have in mind is only useful for either only scaling, or multiplying it to an already existing transformation. As soon as the base transformation is not identity the sale factors apply on the whole upper left 3x3. Just evaluate the multiplication