I created a surface using the example in the documentation for the 'hgtransform' function. I then rotate it through some angle with respect to an arbitrary axis. I would like to obtain the position of the points after doing this. However, the 'xdata','ydata' and 'zdata' property of the handle does not change.
ax = axes('XLim',[-1.5 1.5],'YLim',[-1.5 1.5],'ZLim',[-1.5 1.5]);view(3); grid on; axis equal[x y z] = cylinder([.2 0]);h = surface(x,y,z,'FaceColor','red');xlabel('x'); ylabel('y'); zlabel('z');t = hgtransform('Parent',ax);set(h,'Parent',t)set(gcf,'Renderer','opengl')drawnowx_temp = get(h,'xdata');y_temp = get(h,'ydata');z_temp =get(h,'zdata');Rz = eye(4);Sxy = Rz;r = pi;Rz = makehgtform('xrotate',r);set(t,'Matrix',Rz*Sxy)drawnow
Best Answer