rotate3dlight

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 4.9, Creation date: 2020-01-13, Last change: 2025-09-14

Switches the automatic camera light conditions on and off

Description

Up to Rel 4.8, SGfigure automatically installed view point cameras, which automatically adjusted the lighting conditions of a plot. This slowed down the rotation of large surfaces (detected by Alexandra Mercader). Therefor by default the SG-Lib ist not installing the rotating view point lights anymore, but it is possible to switch this feature on an off by this function.

See Also: camlightTL , VLFLplotlight , SGshadelight , SGshowcolors

Example Illustration

 missing image of rotate3dlight(tog)

Syntax

rotate3dlight([tog])

Input Parameter

tog: 'on', 'off', or toggle by no parameter

Examples


rotate3dlight
rotate3dlight off
rotate3dlight on




Copyright 2020-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 function, rotate3dlight, is designed to toggle the automatic camera lighting conditions in a 3D plot environment. It is part of the SG-Library and was introduced to manage lighting conditions efficiently, especially for large surface plots.

Input Parameters

Algorithm Steps

  1. The function begins by retrieving the input parameter tog using getfuncparams. If no parameter is provided, it defaults to an empty string, which acts as a toggle.
  2. It then checks the current WindowButtonMotionFcn property of the current figure (gcf).
  3. If the WindowButtonMotionFcn is empty, it sets it to 'camlightTL;', which enables the automatic camera lighting.
  4. If the WindowButtonMotionFcn is not empty, it clears it by setting it to an empty string, effectively disabling the automatic camera lighting.
  5. The function then checks the value of tog:
  6. Finally, the function calls shg to bring the current figure window to the front.

Switch Conditions

There are no explicit switch conditions in this function, but the behavior is controlled by the tog parameter and the current state of the WindowButtonMotionFcn.

Algorithm explaination created using ChatGPT on 2025-08-19 07:14. (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