首页 > 代码库 > MATLAB light material lighting

MATLAB light material lighting

clf;
[X,Y,Z]=sphere(40);
colormap(jet)
subplot(1,2,1),surf(X,Y,Z),axis off square,shading interp
light(‘position‘,[0 -10 1.5],‘style‘,‘infinite‘)

material shiny
subplot(1,2,2),surf(X,Y,Z,-Z),axis off square ,shading flat
light;
lighting flat
light(‘position‘,[-1,-1,-2],‘color‘,‘y‘)
light(‘position‘,[-1,0.5,1],‘style‘,‘local‘,‘color‘,‘w‘)
set(gcf,‘Color‘,‘w‘)

 

MATLAB light material lighting