Rotate.m function fixed
Versión 1.1.0.0 (2,53 KB) por
Luc Masset
Surf property "vertexnormals" are updated correctly.
Bug evidence:
[x,y,z] = sphere(20);
hs=surf(x,y,z,'facecolor','y');
view(2)
axis equal
hl=light;
lightangle(hl,0,0)
% light is on -Y axis, thus at the
% bottom
rotate(hs,[0 0 1],30)
% rotate sphere to the right from 30°
It looks like the light has moved. This is due to a bug in rotate.m function. The "VertexNormals" property of the surf object is not updated as "xdata", "ydata" and "zdata" properties are.
This is fixed in the submitted version of rotate.m.
Luc Masset
Citar como
Luc Masset (2026). Rotate.m function fixed (https://la.mathworks.com/matlabcentral/fileexchange/35210-rotate-m-function-fixed), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2009b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Más información sobre Graphics Object Properties en Help Center y MATLAB Answers.
Etiquetas
Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
