transform Coordinate transformation of point cloud. ------------------------------------------------------------------------------ DESCRIPTION/NOTES * Transformation model: ---------------------------- xNew = m * A * xActual + t ---------------------------- where m ... 1-by-1 scale A ... 3-by-3 matrix t ... 3-by-1 translation vector -> [tx; ty; tz] * If coordinates should only be scaled, use the identity matrix as A (command 'eye(3)') and a null vector as translation vector (command 'zeros(3,1)'). * If present, also the normal vectors are transformed. ------------------------------------------------------------------------------ INPUT 1 [m] Scale as scalar. 2 [A] Any matrix of size 3-by-3. 3 [t] Translation vector of size 3-by-1. ------------------------------------------------------------------------------ OUTPUT 1 [obj] Updated object. ------------------------------------------------------------------------------ EXAMPLES 1 Rotate point cloud by 100 gradians (=90 degree) about z axis. pc = pointCloud('Lion.xyz'); R = opk2R(0, 0, 100); % create rotation matrix pc.transform(1, R, zeros(3,1)); % no scale, no translation pc.plot; 2 Apply only scale. pc = pointCloud('Lion.xyz'); pc.transform(1e-3, eye(3), zeros(3,1)); % transformation from mm -> m pc.plot; ------------------------------------------------------------------------------ philipp.glira@gmail.com ------------------------------------------------------------------------------