Other Problem with VideoWriter and zbuffer renderer

2 次查看(过去 30 天)
Hello,
I just read the post http://www.mathworks.de/matlabcentral/answers/19731-videowriter-trouble-creating-the-example-peaks-avi, which helped me avoiding the faded, distorted always the first frame video.
But my sphere (surf) does then forget about the FaceAlpha 0.1 and plots a colormap onto the sphere.
My code is as follows:
vidobj = VideoWriter(moviename,'Motion JPEG AVI');
vidobj.FrameRate = 24;
open(vidobj);
for timeIdx = from_step_to
plot_Orbit(...);
set(gcf,'renderer','zbuffer');
F = getframe(gcf);
writeVideo(vidobj,F);
clf;
end
and
plot_Orbit(...) contains
...
%--- mesh visualization of Earth ----------
[X Y Z] = sphere(20);
X = X * r_earth;
Y = Y * r_earth;
Z = Z * r_earth;
hold on;
surf(X,Y,Z,'FaceAlpha',0.1);
which is neglected with the zBuffer renderer, but not with the OpenGL renderer, which on the other hand does not create a working video.
thx for any advice.

采纳的回答

Titus Edelhofer
Titus Edelhofer 2012-1-3
Hi,
yes, OpenGL is the only renderer capable of transparency. I tried your example and it works fine for me (using OpenGL instead of zbuffer). You might try to use the software driver instead of hardware driver:
opengl software
will use a generic software driver. It's of course not using hardware acceleration but quite often shows less problems then hardware drivers.
Titus

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by