Tofview

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 4.7, Creation date: 2019-07-01, Last change: 2025-09-14

returns the Transformation matrix of the camera for a specific view with a change of view



See Also: Tofcam

Example Illustration

 missing image of Tofview(ew,aw)

Syntax

T=Tofview(ew,aw)

Input Parameter

ew: elevation angle as in view
aw: azimut angle as in view

Output Parameter

T: Transformation matrix

Examples


SGsample(17); A=ans; view(0,0); % left side view
T=Tofcam % by default view
T=Tofview(0,0)
T=Tofview(0,90)




Copyright 2019-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, Tofview, is designed to compute the transformation matrix of a camera for a specific view, based on given elevation and azimuth angles. It is part of the SolidGeometry library and was introduced in version 4.7.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the current view angles using the view function, storing them in eo (elevation) and ao (azimuth).
  2. Set the view to the specified angles ew and aw using the view function.
  3. Apply a rotation transformation with rot(0,pi,0), which rotates the view 180 degrees around the y-axis.
  4. Compute the transformation matrix T using the Tofgca function, which likely retrieves the current transformation matrix of the graphical current axis.
  5. Restore the original view angles using view(eo,ao) to return to the initial view state.

This function is useful for adjusting the camera view in a 3D space and obtaining the corresponding transformation matrix, which can be used for further graphical manipulations or analyses.

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