필터 지우기
필터 지우기

Capturing VR canvas in figure with plots.

조회 수: 1 (최근 30일)
Alexander Tsarev
Alexander Tsarev 2016년 12월 2일
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개)

카테고리

Help CenterFile 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!

Translated by