了解ModelView矩阵 [英] Understanding the ModelView Matrix

查看:205
本文介绍了了解ModelView矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想分析4*4 ModelView矩阵的每个组件.

I want to analyze the each component of my 4*4 ModelView Matrix.

我知道ModelView Matrix的起始3*3存储旋转.

I came to know that the starting 3*3 of ModelView Matrix stores rotation.

如果我希望我的对象具有no rotation with respect to camer a,那么我的ModelView矩阵如下所示

If i want my object to have no rotation with respect to camera so My ModelView Matrix looks like this

如果我想拥有NO Translation or Scaling,如何更改我的ModelView矩阵?谁能解释这个背后的数学.

How to change my ModelView Matrix if i want to have NO Translation or Scaling ? Can anyone explain the Maths behind this.

推荐答案

左上3×3定义坐标系的基本向量.它不仅是旋转,而且是缩放,剪切和类似的东西.想象一下,您可以沿任意方向拉伸和倾斜三个橡胶支脚.这就是左上方的3×3.如果要旋转坐标系,则将分别标记为X,Y,Z的树形支脚旋转到要在另一个坐标系中用该名称表示的方向.如果要缩放比例,可以拉伸每条腿.如果您使它们不垂直,那么它们会被剪断.真的就是全部.

The upper left 3×3 defines the base vectors of a coordinate system. It's not just rotation but also scaling, shearing and similar stuff. Imagine three rubber legs which you can stretch and angle into any direction. This is what the upper left 3×3 does. If you want to rotate a coordinate system, you rotate the tree legs labeled X, Y, Z each into the direction you want to denote by that moniker in the other coordinate system. If you want to scale things, you stretch each leg. If you make them nonperpendicular things get sheared. That's really all there is to it.

但是,由于所有内容(翻译除外)都混杂在左上3×3的部分中,因此从中提取"单个转换并不容易.要遵循的粗略步骤是:

However because everything (except translation) is intermingled in that upper left 3×3 part it's not trivial to "extract" the individual transformations from it. The rough steps to follow are:

  1. 通过主轴定理进行长轴变换,以找到任何各向异性定标的长轴可能已经应用了.
  2. 分解为剪切和旋转部分.
  1. Major axis transform by the Principal axis theorem to find the major axis of any anisotropic scaling that may have been applied.
  2. decomposition into shearing and rotation parts.

翻译恰好位于最右边的列中.最下面的行必须为[0 0 0 1],以便它上面的行中发生的事情以所需的方式工作.

Translation happens to sit in the rightmost column. The lowermost row must be [0 0 0 1] so that the stuff happening in the rows above it work in the desired way.

这篇关于了解ModelView矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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