function f2D = pcamview(f3D, alpha, beta, theta, u0, v0, R, t) 
% projects f3D onto a plane according to the given extrinsic
% and intrinsic parameters

f2D = [];
for p = f3D,
    
    p
   
   %% from 2.17 in forsythe and ponce
   
   M(1,[1:3]) = alpha*R(1,:) - alpha * cot(theta) * R(2,:) + u0 * R(3,:);
   M(2,[1:3]) = beta/sin(theta)*R(2,:) + v0*R(3,:);
   M(3,[1:3]) = R(3,:);
   
   M(1,4) = alpha*t(1) - alpha*cot(theta)*t(2) + u0*t(3);
   M(2,4) = beta/sin(theta)*t(2) + v0*t(3);
   M(3,4) = t(3);
   
   %% from 2.16 in forsythe and ponce
   
   M = M
   z = M(3,:)*p
   u = (M(1,:)*p)/(z)
   v = (M(2,:)*p)/(z)
   
   %u = alpha*x/z - alpha * cot(theta)*y/z + u0;
   %v = beta/sin(theta) * y/z + v0;
   f2D = [f2D [u v]'];
end
    