Hello everyone, I need to generate the image of a Lambertian sphere in Matlab. A Lambertian surface differes from a specular one by the fact that it reflects light in all directions regardless the angle of incidence.
I saw that exists the function
R = diffuse(Nx,Ny,Nz,S)
where Nx, Ny and Nz are the surface's normal vector components. The problem is that I need to generate a sphere.
The result I want to achieve is the following:
The code I've written is:
[x,y,z] = sphere(100);figureh = surf(x,y,z,'FaceColor','w','FaceAlpha',1);set(h,'edgecolor','none');axis equalax = gca; set(ax,'Color','k');light('Position',[1 0 0],'Style','infinite','Color','w');lighting gouraud
but the result I get is:
Best Answer