function [ angle tf vp R] = look_down( phi, f, sz, hallpts ) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here theta = phi*pi/180; vi = [1 0 0]; vk = [0 sin(theta) cos(theta)]; % vi = [0 0 -1]; % vk = [-1 0 0]; vj = cross(vk,vi); A1 = [ 1 0 -sz(2)/2; 0 1 -sz(1)/2; 0 0 -f]; R = [vi; vj; vk]; T1 = R*A1; newcp = [0 0]'; % First entry is -600 for script 8, but +600 for earlier scripts. % Maybe the rotation matrix above is not defined quite right M = [ 600 0 0; 0 -600 0; 0 0 1]*[eye(2,2) -newcp ; 0 0 1]; T = M*T1; tf = maketform('projective',T'); pts = tformfwd(tf,hallpts(:,1),hallpts(:,2)); angle = cross2d(pts(1:2,:),pts(3:4,:)); vp = intersect(pts(1:2,:),pts(3:4,:)); end