From: tomatvandy on
I have an axis on my GUI "axGuiPlot". If I generate a cylinder on the
GUI axis the shape of the cylinder is correct but you can not see the
ends of the cylinder, ie it loos like a big blob. If I use the
commented out code below, and let a new figure be generated,
figure(5), then when I create the cylinder you can see the ends of
the cylinder and it looks 3-D. The only difference in the properties
of the figure(5) and the axis on the GUI is that the figure(5)
properties has "Rendering" listed as a property and it is "OpenGL".
Is there a way to make this OpenGL rendering occur for axis embedded
in a GUI?
Thanks...Tom

------------------- CODE ------------------------
% initialize axes
h=findobj('Type','axes','Tag','axGuiPlot');
axes(h),hold on;
%figure(5),
%a=axes;

axis([-4 4 -4 4 -4 4]); %sets scaling.
axis equal; %Make aspect ratio of x,y,z equal
view(3); % Set view of observer of 3-D plot
cla;

% create a transform to move the satellite around
g=hgtransform;

% Create cylinder
D = .35;
[xc yc zc]=cylinder([0 0 D D D D D D D D D D D D D D D D D D D 0
0],150);

sat=surface('xdata',xc,'ydata',yc,'zdata',zc,...
'facecolor','b','edgecolor','none',...
'parent',g);

camlight headlight;

zrot = rot;

axis off,
set(g,'matrix',makehgtform('zrotate',zrot,'yrotate',yaw,'xrotate',pitc
h,'scale',3,'translate',[0 0 -0.5]));