So I'm having trouble understanding the exact calculations of perspective projections - my teacher makes the lectures in class and there's no textbook for me to reference. I'm creating a simple program in Java for displaying a cube (or really any polygon object) where the viewpoint is at (6, 8, 7.5) with the viewing axis Ze pointed at the origin of the WCS and Xe axis on the Z = 7.5 plane. The screen is said to be 30x30cm with a viewing of 60 cm distance. The cube is as follows:
Xw: -1, 1, 1, 1, -1, 1, 1, -1
Yw: 1, 1, -1, -1, 1, 1, -1, -1
Zw: -1, -1, -1, -1, 1, 1, 1, 1
So far I have been able to simulate 3d geometric transformations and am using a bresenham algorithm to scan convert the lines. However the task of the project is to apply perspective projection which I have really no real understanding of.
It has been described to me that [Xe Ye Ze 1] = [Xw Yw Zw 1][V] and then [Xc Yc Zc 1] = [Xe Ye Ze 1][N] or rather [Xc Yc Zc 1] = [Xw Yw Zw 1] [[V][N]], then map the points onto the screen with Xs = (Xc/Zc)+Vsx + Vcx and Ys=(Yc/Zc)VSy+Vcy. However my main issue is constructing the transformation matrix V given the project terms.
Any help would be greatly appreciated