VLFLcamlight

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 1.0, Creation date: 2012-11-10, Last change: 2025-08-18

set the current light source on the position of the viewpoint

Description

The function uses a persistent local variable

See Also: VLFLplotlight , rotate3dlight

Example Illustration

 missing image of VLFLcamlight

Syntax

VLFLcamlight




Copyright 2012-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, VLFLcamlight, is designed to set the current light source to the position of the viewpoint in a 3D plot. It is part of the SolidGeometry library and was introduced by Tim Lueth in 2012.

Input Parameters

The function does not take any input parameters.

Persistent Variable

The function uses a persistent variable pcamlight to store the handle to the light source. This variable retains its value between function calls.

Algorithm Steps

  1. Check if pcamlight is empty. If it is, initialize it by calling camlightTL, which presumably creates a new light source.
  2. Attempt to set the position of pcamlight to the current camera position using set(pcamlight,'Position',get(gca,'CameraPosition')).
  3. If an error occurs (e.g., if the light source handle is invalid), catch the error and reinitialize pcamlight by calling camlightTL again.

Output

The function does not return any output. It modifies the light source in the current axes of a 3D plot.

Algorithm explaination created using ChatGPT on 2025-08-18 22:08. (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