function [img, xr, yr, zr] = renderConeTemplate(light)
albedo = 1;  % uniform albedo
s0 = .5; % light intensity

% Generate the x,y,z locations of the surface
[x,y] = meshgrid(-1:0.005:1, -.5:0.005:.5);
sz = size(x);
x = x(:)';  y = y(:)';
z = -(x.^2 + 4*y.^2);
valid = z >= -1;
z(valid) = -sqrt(-z(valid));
pts = [x; y; z];

% For each surface point, compute the unit surface normal vector
%%% FILL IN CODE HERE

% For each surface point, compute the unit vector in the direction of the
% light source
%%% FILL IN CODE HERE

% Finally, calculate the image using the dot product between the surface
% normal, the light vector, the albedo and the light intensity
%%% FILL IN CODE HERE
img = ones(1, size(pts, 2)); % replace this line.
 
img(img < 0) = 0;  % if the dot product < 0, the light is behind the surface
img = reshape(img, sz(1), sz(2));
img(~valid) = 0;

xr = reshape(x, sz(1), sz(2));
yr = reshape(y, sz(1), sz(2));
zr = reshape(z, sz(1), sz(2));

end
