by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-11, Last change: 2025-09-14
See Also: viewsmooth
, Videoquickrotate3D
, animatego
, figurerotate
, drawnowvid
viewsmooth(az,el,[n])
az: | azimut similar to view | |
el: | elevantion similar to view | |
n: | number of steps; default is 15 |
SGfigure(-30,30); SGbox; shg; viewsmooth(170,30,20);
This algorithm is a MATLAB function named viewsmooth that smoothly transitions the view of a 3D plot to a new azimuth and elevation over a specified number of steps.
view function.view function.n using the helper function getfuncparams. If n is not provided, it defaults to 15 (calculated as 0.5 * 30).n is then rounded up to the nearest integer using ceil.a (azimuth) and e (elevation) are obtained using the view function.sa = az - a and se = el - e.n-1 to gradually change the view:a + sa/(n-1)*i and e + se/(n-1)*i.drawnowvid function is called to update the display after each change.The function smoothly transitions the view from the current angles to the target angles over the specified number of steps.
Algorithm explaination created using ChatGPT on 2025-08-18 22:52. (Please note: No guarantee for the correctness of this explanation)