Taking cube from camera space to clip space, error in my math?

五迷三道 提交于 2020-04-30 05:42:49

问题


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.

Ken's view matrix:

After view matrix has been applied:

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

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.


回答1:


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).

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:



来源:https://stackoverflow.com/questions/58108179/taking-cube-from-camera-space-to-clip-space-error-in-my-math

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!