防止对象在视频中“跳跃”

时间:2015-03-25 09:34:31

标签: matlab

我想使用VideoWriter类使用Matlab制作视频。我有几个对象的帧作为单点云,我想将帧一个接一个地放入我的视频中。至于现在,我这样做:

function [] = makeMyVideo(videoPath, framerate, filenamestoplot)

writerObj = VideoWriter(videoPath);
writerObj.FrameRate = framerate;
open(writerObj);


figure;ptHandles = onePlot(filenamestoplot);axis off;view(54,12);
axis tight
set(gca,'nextplot','add');
set(gcf,'Renderer','zbuffer');
firstCameraPos = campos;
for k = 1:numel(filenamestoplot)
   pause(0.1);
   delete(ptHandles);
   ptHandles = onePlot(filenamestoplot(k));axis off;view(54,12);
   campos(firstCameraPos);
   frame = getframe(gcf);
   writeVideo(writerObj,frame);
end

close(writerObj);

end

这样可行,但我的3D对象是“跳跃”#34;我试图通过为每一帧设置相机位置来解决这个问题,但不幸的是,这并没有解决问题。你有什么想法,如何解决这个问题?

谢谢!

0 个答案:

没有答案