从摄影机空间获取立方体到剪辑空间,我的数学错误吗? [英] Taking cube from camera space to clip space, error in my math?

查看:61
本文介绍了从摄影机空间获取立方体到剪辑空间,我的数学错误吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

观看youtube上Ken Joy的计算机图形学讲座.让我感到困惑的一件事是,他将摄影机空间中的多维数据集转换为剪辑空间后,根据我的计算,该多维数据集看起来并非如此.我希望立方体在我的图片中看起来像是粉红色的平行四边形,如果我们假设立方体正面的Z为-4/3,背面的-2为-2,则Ws为4/3和2.因此,有人可以解释如何将多维数据集乘以观察矩阵后看起来像Ken的样子.

watching Ken Joy's Computer Graphics lectures on youtube. One thing I'm confused about is after he gets the cube from the camera space to clip space, from my calculations the cube doesn't look like that. I expected the cube to look like that pink parallelogram in my picture, if we assume the Z of the front-face of the cube to be -4/3 and the back-face to be -2 then the Ws come out to be 4/3 and 2 respectively. So can someone explain how after multiplying by the viewing matrix, the cube comes out to look like how Ken has it.

肯的视野矩阵:

应用视图矩阵后:

应用视图矩阵后,我认为立方体的侧面应该看起来像(粉红色的平行四边形):

What I think the side of the cube should look like(the pink parallelogram) after view matrix has been applied:

我的推理是,将透视图除以W后,应该将蓝色和绿色矢量截断以创建该粉红色平行四边形.因此,我很难理解这一点.预先感谢.

my reasoning is, after the perspective divide by W, the blue and green vectors should get truncated to create that pink parallelogram. So I'm struggling to understand this. Thanks in advance.

推荐答案

在Perspective Projection上,该场景被视为来自针孔相机.与图中放置在Y +(在轴上方)的立方体相比,校板上的立方体绕z轴对称放置.

At Perspective Projection the scene is seen as from of a pinhole camera. The cube on the school board is placed symmetrically around the z axis, in compare to the cube in the illustration which is placed at Y+ (above the axis).

z轴与立方体相交时,您既看不到立方体的顶部,也看不到底部:

When the z axis intersects the cube, then you can neither see the top, nor the bottom of the cube:

提起多维数据集后,您也可以看到多维数据集的底部:

When the cube is lifted up, then you can see the bottom of the cube, too:

这篇关于从摄影机空间获取立方体到剪辑空间,我的数学错误吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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