Syntax
rotateazimut(hf)
Input Parameter
Examples
set (hf,'WindowScrollWheelFcn',@figrotateazimut);
Copyright 2015-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 designed to rotate the azimuth angle of a 3D plot in a figure window using the mouse scroll wheel. It is part of a user interface library and is intended to be set as a callback function for the 'WindowScrollWheelFcn' property of a figure.
Input Parameters
- src: The source of the callback, typically the figure handle.
- callbackdata: A structure containing data about the scroll wheel event, specifically the 'VerticalScrollCount' which indicates the direction and amount of scroll.
Algorithm Steps
- The function begins by checking the value of 'callbackdata.VerticalScrollCount'.
- If 'VerticalScrollCount' is greater than 0, it indicates a scroll up action:
- The current view angles (azimuth 'a' and elevation 'z') are retrieved using the 'view' function.
- The azimuth angle 'a' is increased by 5 degrees.
- The 'view' function is called again to update the plot with the new azimuth angle.
- 'drawnow' is called to immediately update the figure window with the changes.
- If 'VerticalScrollCount' is less than 0, it indicates a scroll down action:
- The current view angles (azimuth 'a' and elevation 'z') are retrieved using the 'view' function.
- The azimuth angle 'a' is decreased by 5 degrees.
- The 'view' function is called again to update the plot with the new azimuth angle.
- 'drawnow' is called to immediately update the figure window with the changes.
Example Usage
To use this function, set it as the 'WindowScrollWheelFcn' for a figure handle 'hf':
set(hf, 'WindowScrollWheelFcn', @figrotateazimut);
Algorithm explaination created using ChatGPT on 2025-08-18 22:48. (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