Capturing VR canvas in figure with plots.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur View and Analyze Simulation Results dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!