camlightTL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 4.3, Creation date: 2018-09-15, Last change: 2025-08-19

deletes all camlights and set three new

Description

2020-08-25 modified and successfully tested for Matlab2020aUpd5
camlight('headlight','infinite'); ...
camlight('right','infinite');...
camlight('left','infinite');];

See Also: camlightTL , camplot , camset , selectCameraPosition , tcamera , Tofcam , TofcamVLPL , VLFLcamlight , rotate3dlight

Example Illustration

 missing image of camlightTL

Syntax

h=camlightTL

Output Parameter

h: handle to three camlights

Examples


SGfigure; SGplot(SGbox(4)); view(-30,30);
camlightTL




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)

The function camlightTL is designed to manage lighting in a 3D plot in MATLAB. It deletes existing camlights and sets up new ones based on the specified mode.

Input Parameters

Algorithm Steps

  1. Initialize the mode to 'on'. If an argument is provided, use it to set the mode. Convert the mode to lowercase for consistency.
  2. Retrieve all children of the current axes using get(gca,'Children').
  3. Find all objects of type 'Light' among the children and delete them using findobj and delete.
  4. Initialize an empty array h to store handles to the new camlights.
  5. If the mode is 'on', proceed to set up new camlights:

Output

Example Usage

To use this function, you can create a figure and plot a 3D object, then call camlightTL to set up the lighting:

SGfigure; 
SGplot(SGbox(4)); 
view(-30,30);
camlightTL;
Algorithm explaination created using ChatGPT on 2025-08-19 07: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