Syntax
VLT=VLtransT(VL,T)
Input Parameter
VL : | | Vertex list n x 3 |
T : | | Transformation matrix 4 x 4 |
Output Parameter
VLT : | | Tranformed vertex list |
Copyright 2010-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, VLtransT
, transforms a list of vertices using a homogeneous transformation matrix. It is part of the SG-Library and was introduced in SolidGeometry 1.0.
Input Parameters
- VL1: The original vertex list. It is expected to be an Nx3 matrix, where N is the number of vertices. If the input is Nx2, a z-coordinate of zero is added to each vertex.
- T: A 4x4 homogeneous transformation matrix. This matrix is used to apply transformations such as translation, rotation, and scaling to the vertices.
Output
- VL: The transformed vertex list. It is an Nx3 matrix, where each vertex has been transformed according to the matrix
T
.
Algorithm Steps
- Check if the input vertex list
VL1
has two columns. If so, add a third column with zeros to represent the z-coordinate. This ensures that all vertices are in 3D space.
- Determine the number of vertices,
n
, in VL1
.
- If
VL1
is empty, return an empty matrix VL
.
- Initialize an empty matrix
VL
with dimensions n x 3
to store the transformed vertices.
- Iterate over each vertex in
VL1
:
- For each vertex, apply the transformation by multiplying the 3x3 submatrix of
T
with the vertex coordinates and adding the translation vector from T
.
- Store the transformed vertex in the corresponding row of
VL
.
- If no output argument is specified, plot the transformed vertices using
SGfigure
and VLplot
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:06. (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