%  Code to create a depth map of a rectangular geometrical figure

Z=zeros(480,642);
space = linspace(1,0,100);
Z(1:159,1:642)=0;

Z(321:480,1:642)=0;
Z(160:320,265:378)=1;

for pointery = 161:319
    for pointerx = 1:100
    
        Z(pointery,264-pointerx)= space(pointerx);
    end
    
end

for pointery = 161:319
    for pointerx = 379:477    
        Z(pointery,pointerx)= space(pointerx-377);
    end
    
end
