首页 > 其他分享 >图形学(2)Viewing Transformation

图形学(2)Viewing Transformation

时间:2023-03-13 23:22:17浏览次数:32  
标签:end 图形学 times 相机 Viewing bmatrix hat Transformation view

Model View transformation(模型视图变换)

注意到定义一个相机我们需要三个矢量:

  • 位置 \(\vec{e}\)
  • 视线方向 \(\hat{g}\)
  • 向上方向 \(\hat{t}\)

    注意到我们的目标就是将相机固定到原点,并使 \(\hat{g},\hat{t}\) 和坐标轴对齐。

约定

我们最终让相机的向上方向 \(\hat{t}\) 为 \(y\) 轴,视线方向 \(\hat{g}\) 为 \(-z\) 轴。

移动 \(\vec{e}\) 至原点

\[T_{view}=\begin{bmatrix} 1 & 0 & 0 & -x_e\\ 0 & 1 & 0 & -y_e\\ 0 & 0 & 1 & -z_e\\ 0 & 0 & 0 & 1 \end{bmatrix} \]

将 \(\hat{g},\hat{t}\) 与坐标轴对齐

考虑其逆矩阵:

\[R^{-1}_{view}=\begin{bmatrix} x_{\hat{g}\times\hat{t}} & x_{\hat{t}} & x_{-\hat{g}} & 0\\ y_{\hat{g}\times\hat{t}} & y_{\hat{t}} & y_{-\hat{g}} & 0\\ z_{\hat{g}\times\hat{t}} & z_{\hat{t}} & z_{-\hat{g}} & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} \]

注意到 这是一个正交矩阵,其逆矩阵为其转置,故有:

\[R_{view}=(R^{-1}_{view})^\mathbf{T}= \begin{bmatrix} x_{\hat{g}\times\hat{t}} & y_{\hat{g}\times\hat{t}} & z_{\hat{g}\times\hat{t}} & 0\\ x_{\hat{t}} & y_{\hat{t}} & z_{\hat{t}} & 0\\ x_{-\hat{g}} & y_{-\hat{g}} & z_{-\hat{g}} & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} \]

则有 \(M_{view}=R_{view}T_{view}\);让所有物体和相机一起做同样的变换,即得到结果。

Projection View(投影变换)

TODO...

标签:end,图形学,times,相机,Viewing,bmatrix,hat,Transformation,view
From: https://www.cnblogs.com/watware-cym/p/17213354.html

相关文章

  • Games101-Cp1-Transformation
    最近为了求职重新开始把图形学相关的内容重新系统的学习,先把Games101的内容入门,然后把虎书相关的内容补充。Transformation矩阵变换可以对不同坐标系之间进行转换,在这个......
  • 图形学——单词
    determine确定formulate制定layoutanddimension布局和尺寸spatial空间的3Disovist三维可视域SpaceSampling(DataCollectionUsing3DIsovist)使用3Dinsovist......
  • 图形学(1)简单三维变换
    缩放。。。平移。。。旋转绕坐标轴的旋转矩阵记\(R_x(\alpha)\)为绕\(x\)轴顺时针旋转\(\alpha\),以此类推。\[\begin{align*}&\mathbfR_x(\alpha)=\begin{......
  • 图形学(0)一些约定和基本概念
    齐次坐标由于平移不是线性变换,我们定义齐次坐标,以三维为例,齐次坐标形如\[\begin{pmatrix}x\\y\\z\\w\end{pmatrix}\]其中\((x,y,z)^\top\)是三维坐标,\(w\)项的......
  • BlendFunc——图形学混合方式
     1、根据 纹理 是否alpha预乘,决定混合方式voidSprite::updateBlendFunc(void){CCASSERT(!_batchNode,"CCSprite:updateBlendFuncdoesn't......
  • 图形学数据结构 half-edge
    这个东西,看了之后只有一个感觉WC你看了之后,很可能会感觉 俺也一样这是​​https://www.flipcode.com/archives/The_Half-Edge_Data_Structure.shtml​​介绍是用来精细化......
  • 常见英文缩写 (图形学相关)
    学习Games101课程bayerpattern(显示屏的RGB期间陈列)包围盒aabb(AxisAlignedBoundingBox)OrientedBoundingBoxhttp://www.open3d.org/docs/latest/python_api/op......
  • Codeforces1059C. Sequence Transformation 好题 没做出来 数学思维
     C.SequenceTransformationtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputLet'scallthefollowingproce......
  • Viewing the Call Stack in WinDbg
    ViewingtheCallStackinWinDbgThecallstackisthechainoffunctioncallsthathaveledtothecurrentlocationoftheprogramcounter.Thetopfunctiono......
  • 2/1 图形学 04
      这三个角叫做欧拉角(在数学上)罗德里德斯旋转公式 ......