0
私は陰影をつけた3-Dオブジェクトの3次元プロットを持っています。ユーザーがプロットを回転させたとき、光源を常にユーザーが見ている方向から更新するようにしますか?Matlab:Moving Light Source
私は陰影をつけた3-Dオブジェクトの3次元プロットを持っています。ユーザーがプロットを回転させたとき、光源を常にユーザーが見ている方向から更新するようにしますか?Matlab:Moving Light Source
MATLABのcamlight
コマンド(online documentation)をご覧ください。
ここであなたが始めるために、最小限のデモです:
function camlight_demo
% some example data to plot
surf(peaks);
h = rotate3d;
set(h,'Enable','on');
% add a light
LightSource = camlight('headlight');
% add a callback which will be executed after each rotation
set(h,'ActionPostCallback',{@move_light_source, LightSource});
end
% This function will move the light after each rotation
function move_light_source(src, evt, LightSource)
camlight(LightSource, 'headlight');
end