Ring FastPro transform3d( ) Function Added

20 views
Skip to first unread message

Bert Mariani

unread,
Mar 28, 2026, 1:23:13 PM (6 days ago) Mar 28
to The Ring Programming Language
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
Mug-New-Speed-Snap1.png

OLD SPEED - 27 msec/cycle
Mug-Old-Speed-Snap2.png

fastpro.c
Mug-Rotation-FastPro-Transform.ring

Mahmoud Fayed

unread,
Mar 28, 2026, 1:46:04 PM (6 days ago) Mar 28
to The Ring Programming Language
Hello Bert

Thank you very much


Keep up the GREAT WORK :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages