Syntax
setcamangle([na,nd])
Input Parameter
na : | | empty or 3D point or 4x4 HT Matrix |
nd : | | |
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, setcamangle
, is designed to set the camera angle in a 3D visualization environment. It is part of a library used for AIM lectures and was introduced in SolidGeometry 5.2.
Input Parameters
- na: This can be an empty value, a 3D point, or a 4x4 Homogeneous Transformation (HT) Matrix.
- nd: This parameter is optional and can be used to adjust the zoom factor.
Algorithm Steps
- Retrieve the input parameters
na
and nd
using the getfuncparams
function.
- Set the camera modes to "manual" for position, target, and view angle using
set(gca,...)
.
- Get the current camera properties: position (
cp
), target (ct
), view angle (ca
), and up vector (cu
).
- Calculate the eye-to-center vector (
ec
) and its distance (dc
).
- Initialize the zoom factor (
zz
) to 1. If nd
is not empty, adjust zz
to nd/dc
.
- Use
shg
to bring the current figure window to the front.
- If
na
is not empty, adjust the camera position and view angle:
- Calculate the scaling factor
k
as ca/na
.
- Set the new camera position using
ct + k * ec * zz
.
- Adjust the camera view angle to
ca/k
.
- Update the camera properties: position (
cp
), view angle (ca
), eye-to-center vector (ec
), and distance (dc
).
- If there are no output arguments, print the camera distance and angle using
dbprintf
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:00. (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