%DEMO3D.M
%
%Driver for a demo of plot3d.m
%
%                                        A. Knight Nov 1991
%

% define the cube

x =     [0 0 0 0 1 1 1 1 .5  .5];
y =     [0 0 1 1 0 0 1 1  1   0 ];
z =     [0 1 0 1 0 1 0 1 1.5 1.5];

% Define the indeces which will join the vertices to make a standard
% house:

index = [1 2 10 6 5 1 3 7 8 9 4 3 4 2 10 9 8 6 5 7];

big = 2;umin = -big;umax = big;vmin = -big;vmax = big;
window = [umin umax vmin vmax];
vrp = [1.1 1.1 1.1];        
vpn = [0 1 0];         
vup = [0 0 1];
cop = [2 1.5 1.2];

while 1
   vrp,vpn,vup,cop,window
   keyboard
   [u,v] = plot3d(x,y,z,vrp,vpn,vup,cop,window);
   axis(window)
   plot(u(index),v(index))
   pause
end


