Derivation Orthographic projection and Perspective projection

3D transformations

About Homogeneous coordinates

it help to deal with translation:

3D point =(x,y,z,1)   (x,y,z,1)==(2x,2y,2z,2) thus The point  is actually (x,y,z,w)  (x/w,y/w,z/w) 

3D vector =(x,y,z,0)

In 3 Dimension the matrix of translation :

\begin{bmatrix} 1 & 0 & 0 & x\\ 0& 1 & 0& y\\ 0 & 0 & 1& z\\ 0 & 0 & 0& 1 \end{bmatrix}

Scale:

\begin{bmatrix} x &0 &0 &0 \\ 0 & y& 0& 0\\ 0&0 &z & 0\\ 0& 0 & 0 & 1 \end{bmatrix}

Rotation:

we know rotation in 2 Dimension is ease:

\begin{bmatrix} cos\Theta & sin\Theta \\ -sin\Theta & cos\Theta \end{bmatrix}

But, It imagines difficultly in 3 Dimension.

 

R_{z}(\alpha )=\begin{bmatrix} \cos \alpha & -\sin \alpha & 0 &0 \\ \sin \alpha & \cos \alpha 0& 0& 0\\ 0 & 0 & 1 &0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

R_{x}(\alpha )= \begin{bmatrix} 1 & 0 & 0 &0 \\ 0 & \cos \alpha & -\sin \alpha & 0 \\ 0 & \sin \alpha & \cos \alpha & 0\\ 0 & 0 & 0 & 1 \end{bmatrix}

R_{y}(\alpha )=\begin{bmatrix} \cos \alpha &0& \sin \alpha &0 \\ 0 & 1 & 0 &0 \\ -\sin \alpha & 0&\cos \alpha 0& 0\\ 0 & 0 & 0 & 1 \end{bmatrix}

derivation Rodrigues' rotation formula:

I comprehend not completely the formula.

recorder information to here:

 

this image from https://blog.csdn.net/qq_15698613/article/details/84031711

View/Camera Transformation

 

Translates e to the origin

Rotates g to -Z

Rotates t to Y

Rotates (g x t) to X

M_{view} In math:

 M_{view}=R_{view}T_{view}

translate e to the origin:

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}

Rotate g to -Z, t to Y, (g x t) to X:

g to -Z is difficult, thus we can -Z to g and inverse the rotation matrix.

 

 

1. squish the frustum into the cuboid(n->n,f->n)(Mpersp->ortho)

**the article has not completed

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值