Hello Mahmoud et ALL
Ring FastPro
Added a new function - transform3d( FC, RC )
Attached:
- fastpro.c
- Mug-Rotation-FastPro-Transform.ring (sample)
Result:
Mug rotation is 2X faster --- 13 msec vs 27 msec
Simple to use:
//===========================================================
// ring_transform3d -- Apply a 4x4 transformation matrix
// to every point in a Nx4 point array.
//
// Ring call:
// transform3d( FC, RC )
//
// FC : List[4][4] -- combined 4x4 transformation matrix
// (result of Rotation * Scale * Translate *
// Shear * Reflection chain, as built in
// Mug-Rotation-C-Calc.ring DrawMatrix())
// RC : List[N][4] -- point array [x, y, z, 1]
// transformed in-place: RC[i][1..3]
// are overwritten with the new x',y',z'
//
// Each point is treated as a column vector [x,y,z,1]^T.
// The result column vector R = FC * P is computed for every
// row i of RC, and the first three components are written back.
//
===============================================
NEW SPEED - 13 msec/cycle
OLD SPEED - 27 msec/cycle