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

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.

• Did you factor it in, that the (x, y, z) coordinates will change as well? – Bálint Sep 26 '19 at 5:34
• @Bálint yes, they'll essentially be squished into that cuboid of range {(x, y, z) | -1 =<x,y,z <= 1}. I just don't understand, how the divide by W creates that shape he has. – user132696 Sep 26 '19 at 16:21
• OOOOH OK, so I think it's because of where I have the cube relative to my camera. So my picture would emphasize the bottom of the cube, as the cube is above the camera. But in his picture the cube is dead center to the camera so he'll see a square. If the cube was below the camera then the top would be emphasized. I think that's it. – user132696 Sep 26 '19 at 16:34  