

clear;
%close all;
figure(2); clf; hold on; axis equal;
shading faceted;

% Draw floor:
floorColor1 = [13,239,255]/256;
floorColor2 = [250,239,255]/256;
[x,y] = meshgrid([-35:35],[-35:35]);
z = zeros(size(x,2), size(y,2));
surface(x,y,z,'FaceColor', floorColor1, 'EdgeColor', floorColor2);

% Draw cone:
coneColor = [1,0,0];
[x,y,z]=cylinder([0,1],40);
surf(1.5*x,1.5*y,3*(1-z), 'FaceColor', 'b', 'EdgeColor', 'b');

% Draw cube:
a = [0 0; 0 0];
b = [0 1; 0 1];
c = [0 0; 1 1];
s = 2.5;
x = 3;
y = 0;
mesh(a-x, s*b, s*c, 'FaceColor', 'r');
mesh(a-x-s, s*b, s*c, 'FaceColor', 'r');
mesh(s*b-x-s, a-y, s*c, 'FaceColor', 'r');
mesh(s*b-x-s, s*c, a+s, 'FaceColor', 'r', 'EdgeColor', 'k');

% Draw sphere:
radius = 1.5;
[x,y,z] = ellipsoid(-1,3,radius,radius,radius,radius,40);
surf(x,y,z);

%az = 95;
%el = 10;
%phi = 25;
%xc = [1,3,4];
%T = viewmtx(az, el, phi, xc);
%view(T);

% Draw Camera 1 Location:
x = -15;
y = -20;
z = .1
plot3([x x], [y y], [0 z], 'k');

% Draw Camera 2 Location:
x = 25;
y = -20;
z = .1;
plot3([x x], [y y], [0 z], 'k');

%view(-34,7);
%view(52,5);
%view(34,7);
%view(4,8);

%total = view(2,16);

% Draw Current Image Location:
x = -2;
y = -30;
z = .1;
plot3([x x], [y y], [0 z], 'k');

total2 = view(21,12);
