1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| function test
% Valeurs relevées dans material.m
mat = [0.3 0.6 0.9 20 1.0
0.3 0.8 0.0 10 1.0
0.3 0.3 1.0 25 .5];
[x,y,z] = sphere(30);
figure
hold on
for n = 1:3
s(n) = surf(x+2*(n-1),y,z);
set(s(n),'facecolor','r', ...
'edgecolor','none', ...
'facelighting','phong', ...
'ambientstrength', mat(n,1), ...
'diffusestrength', mat(n,2), ...
'specularstrength', mat(n,3), ...
'specularexponent', mat(n,4), ...
'specularcolorreflectance', mat(n,5));
end
view(3)
axis equal vis3d
cameratoolbar
cameratoolbar('togglescenelight') |
Partager