调用:light('color',[1,1,1],'style','local or
infinite',‘position’,[x,y,z])
本地光:x,y,z表示光源位置。无穷远光:x,y,z表示无穷远光通过该点射向原点。(exno69)
exno69:
subplot(221)
membrane %这是一个库函数
light('color',[0.9 0.5 0.1],'position',[0 -2 1])
%风格省略为无穷远,光顺序通过(0 0 0)和(0 -2 1)
subplot(222)
membrane
light('color',[0.9 0 0.1],'style','local','position',[1 -1
1])
%风格省略为无穷远,光顺序通过(0 0 0)和(0 -2 1)
与之相关的函数还有
lighting material shading等
(exno70)
(exno73)
exno70:
%未加灯光效果的z函数表面图形
subplot(221)
ezsurf('sin(sqrt(x^2 y^2))/sqrt(x^2 y^2)',[-6*pi,6*pi])
subplot(222)
%添加灯光效果的Z函数表面图形
ezsurf('sin(sqrt(x^2 y^2))/sqrt(x^2 y^2)',[-6*pi,6*pi])
view(0,75)
shading interp
%SHADING Color shading mode.(颜色浓度模式)
% shading flat each mesh line segment and face
% has a constant color determined by the color
% value at the end point of the segment or the
% corner of the face that has the smallest index or indices.
% shading faceted flat shading with superimposed black mesh
lines.
% This is the default shading mode.
% shading interp varies the color in each line segment
% and face by interpolating the colormap
% index or true color value across the line or
face.