- 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
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Carmine Buonagura
am 4 Okt. 2020
Beantwortet: Adam Danz
am 5 Okt. 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 Kommentare
Akzeptierte Antwort
Adam Danz
am 5 Okt. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!