CGGenTransMatrixZ2Dir
Section: C Library Functions (3)
Updated: IRIT Version 6.0
Index
Return to Main Contents
NAME
CGGenTransMatrixZ2Dir()
SYNOPSIS
geom_lib/geomat3d.c:1145
void CGGenTransMatrixZ2Dir(MatrixType Mat,
VectorType Trans,
VectorType Dir,
RealType Scale)
DESCRIPTION
Routine to prepare a transformation martix to do the following (in this
order): scale by Scale, rotate such that the Z axis is in direction Dir
and then translate by Trans.
Algorithm: given the Trans vector, it forms the 4th line of Mat. Dir is
used to form the second line (the first 3 lines set the rotation), and
finally Scale is used to scale first 3 lines/columns to the needed scale:
| Tx Ty Tz 0 | A transformation which takes the coord
| Bx By Bz 0 | system into T, N & B as required and
[X Y Z 1] * | Nx Ny Nz 0 | then translate it to C. T, N, B are
| Cx Cy Cz 1 | scaled by Scale.
N is exactly Dir (unit vec) but we got freedom on T & B which must be on
a plane perpendicular to N and perpendicular between them but thats all!
T is therefore selected using this (heuristic ?) algorithm:
Let P be the axis of which the absolute N coefficient is the smallest.
Let B be (N cross P) and T be (B cross N).
PARAMETERS:
Mat: To place the computed transformation.
Trans: Translation factor.
Dir: Direction to take Z axis to.
Scale: Scaling factor.
FUNCTION RETURN VALUE
void
ORIGIN
(C) Copyright 1989/90-95 Gershon Elber, Technion, IIT
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- PARAMETERS:
-
- FUNCTION RETURN VALUE
-
- ORIGIN
-
This document was created by
man2html,
using the manual pages.
Time: 07:28:15 GMT, July 20, 2024