Capturing VR canvas in figure with plots.
3 ビュー (過去 30 日間)
古いコメントを表示
I am running a simulink vr-sink block and an S-function to display a vr.canvas on a figure with plots.(Modified version of the 'Vehicle Dynamics Visualization with Graphs' example).
I want to record the whole figure in to a video -> canvas with the plots.
To initialize the figure I use:
vr_world = vrworld(filePath);
open(vr_world);
FigHandle = figure();
c1 = vr.canvas(vr_world, 'Parent', FigHandle);
v = VideoWriter('newfile.avi');
set(v,'FrameRate',20,'Quality',90);
open(v)
Then when I update the figure plots and try to capture a frame:
F = getframe(FigHandle);
writeVideo(v,F);
After closing the videowriter, the video will play back, but without the canvas. The video will show the plots updating and a white square where the canvas was. To combat this I tried using:
c1P = capture(c1); % c1 is created in another similar figure
imshow(c1P, 'Parent', c1_Axes)
F = getframe(FigHandle);
writeVideo(v,F);
While this works it is very slow, and for a couple hour capture it can be a problem. Is there a more direct/ time efficient way to do this type of capture? Thanks.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で View and Analyze Simulation Results についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!