- http://www.noveldevicelab.com/files/2018-08/light-out-coupling-for-reflective-displays-simple-geometrical-model-matlab-simulation-and-experimental-validation-2011-2.pdf
- https://www.cs.rochester.edu/u/brown/173/exercises/matrices/applications/raytrace.html
- https://cseweb.ucsd.edu/classes/fa12/cse252A-a/hw2/hw2.pdf
How to create a Lambertian (diffuse) sphere
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Carmine Buonagura
el 4 de Oct. de 2020
Respondida: Adam Danz
el 5 de Oct. de 2020
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);
figure
h = surf(x,y,z,'FaceColor','w','FaceAlpha',1);
set(h,'edgecolor','none');
axis equal
ax = gca; set(ax,'Color','k');
light('Position',[1 0 0],'Style','infinite','Color','w');
lighting gouraud
but the result I get is:
0 comentarios
Respuesta aceptada
Adam Danz
el 5 de Oct. de 2020
There are probably official definitions and methods for a Lambertian diffuse sphere but here's something that looks like it.
[x,y,z] = sphere(100);
figure
h = surf(x,y,z,'FaceColor','w','FaceAlpha',1);
set(h,'edgecolor','none');
axis equal
ax = gca; set(ax,'Color','k');
light('Position',[-1 -2 0],'Style','infinite','Color','w');
lighting gouraud
h.BackFaceLighting = 'unlit';
h.DiffuseStrength = .6;
h.SpecularStrength = 0;
h.AmbientStrength = .07;
Potentially relevant literature
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!