Syntax
RVL=VLswapYX(VL)
Input Parameter
Output Parameter
RVL : | | Rotated vertex list. |
Copyright 2012-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, VLswapYX
, performs a specific transformation on a vertex list (VL) by rotating it around the z-axis by -90 degrees. The transformation changes the coordinates from [x y z] to [y -x z]. This is a fast operation used in 2D/3D graphics to achieve a 90-degree rotation around the z-axis.
Input Parameters
- VL: The original vertex list, which is a matrix where each row represents a vertex with coordinates [x y z].
Output Results
- RVL: The rotated vertex list, where each vertex has been transformed to [y -x z].
Algorithm Explanation
The function takes the input vertex list VL
and applies a transformation to each vertex. The transformation is achieved by reordering and negating the coordinates as follows:
- The y-coordinate of the original vertex becomes the x-coordinate of the rotated vertex.
- The x-coordinate of the original vertex is negated and becomes the y-coordinate of the rotated vertex.
- The z-coordinate remains unchanged.
This transformation is implemented in a single line of code:
RVL = [VL(:,2) -VL(:,1) VL(:,3)];
Here, VL(:,2)
extracts the y-coordinates, -VL(:,1)
negates the x-coordinates, and VL(:,3)
keeps the z-coordinates unchanged. The result is a new matrix RVL
with the transformed vertices.
Algorithm explaination created using ChatGPT on 2025-08-18 23:17. (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