Cannot use GETFRAME when rendering in OpenGL
Show older comments
I'm trying to render this code:
myVideo=VideoWriter('video.avi');
myVideo.FrameRate=4;
open(myVideo);
fnPLOT % Plots a patch graphic to an axes
for index=1:10
fnRotate % rotates the rendered graphic
drawnow
currFrame=getFrame(gcf);
writeVideo(myVideo,currFrame);
end
close(myVideo);
This makes a figure animation that rotates. The problem is that getFrame grabs a blank frame rather than the figure.
System: Windows-7x64, Matlab R2011a, Nvidia GeForce GTX 280M (SLI)
What I've tried:
1. Switching to zbuffers as the rendering engine works. However, my patch has alpha (transparancy) properties which are not rendered using zbuffers.
2. Disabled Aero interface (never used it to begin with)
3. Tried on dual monitor setup and single monitor.
4. Tried using figure embedded ("docked") within Java GUI
5. Tried assigning figure handle to figure, and using getFrame(h).
6. Tried capturing frames to a structure variable, then outputing that variable using the writeVideo command.
F(index)=getFrame;
end
writeVideo(myVideo,F);
close(myVideo);
None of these seem to work. Has anyone else run into this difficulty?
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!