setcamtarget

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 5.2, Creation date: 2022-12-09, Last change: 2025-09-15

set the camera target interactively by a mouse click or a point or a frame

Description

This function belongs to a set of function useful for AIM lectures

See Also: setcamzoom , setcamdistance , setcamdirection

Example Illustration

 missing image of setcamtarget (pp)

Syntax

setcamtarget([pp])

Input Parameter

pp: empty or 3D point or 4x4 HT Matrix

Examples


load AIM.mat; VM=V; [AM,as]=VMresize(VM,[0.5 0.5 0.5],vs); AM(:,230:256,:)=0;
SG=SGofVMisosurface(AM>1400,as);
SGfigure; SGplotalpha(SG,'w',0.5); rotate3dlight('off')
view(-30,30); setcamtarget




Copyright 2022-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, setcamtarget, is designed to set the camera target in a 3D plot interactively or programmatically. It is part of a visualization library used in AIM lectures.

Input Parameters

Algorithm Steps

  1. Retrieve the input parameter pp using getfuncparams. If no parameter is provided, it defaults to an empty value.
  2. Initialize an empty matrix T to store the transformation matrix.
  3. Check if pp is empty:
  4. If pp is not empty:
  5. Retrieve the current camera target and position using get(gca,'CameraTarget') and get(gca,'CameraPosition').
  6. Calculate the vector ez from the camera position to the target.
  7. Compute the transformation matrix T using the function TofPez, which takes pp and ez as inputs.
Algorithm explaination created using ChatGPT on 2025-08-19 00:55. (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