www.gusucode.com > sl3d 案例源码程序 matlab代码 > sl3d/CaptureanRGBImageofaFigureExample.m

    %% Capture an RGB Image of a Figure  

%% 
% Create and open a |vrworld| object and associate it with the virtual world
% |vrmount.wrl|. 
myworld = vrworld('vrmount.wrl');
open(myworld);  

%% 
% View the virtual world in the Simulink(R) 3D Animation(TM) Viewer. 
f = vrfigure(myworld);  

%% 
% Create an RGB image of the figure.  

%%  
image_capture = capture(f);  

%% 
% Display the RGB figure image in a MATLAB(R) figure window. 
image(image_capture);