viewsmooth

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

slowly rotates to a new viwe



See Also: viewsmooth , Videoquickrotate3D , animatego , figurerotate , drawnowvid

Example Illustration

 missing image of viewsmooth (az,el,n)

Syntax

viewsmooth(az,el,[n])

Input Parameter

az: azimut similar to view
el: elevantion similar to view
n: number of steps; default is 15

Examples


SGfigure(-30,30); SGbox; shg; viewsmooth(170,30,20);




Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

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.

Input Parameters

Algorithm Steps

  1. The function begins by determining the number of steps n using the helper function getfuncparams. If n is not provided, it defaults to 15 (calculated as 0.5 * 30).
  2. The number of steps n is then rounded up to the nearest integer using ceil.
  3. The current view angles a (azimuth) and e (elevation) are obtained using the view function.
  4. The differences between the target and current angles are calculated as sa = az - a and se = el - e.
  5. A loop iterates from 0 to n-1 to gradually change the view:

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)

Last html export of this page out of FM database by TL: 2025-09-21