bestRotation = function( baseRotate, rotations ) {
            var bestScore;
            var bestRotation;

            for ( var i = 0; i < rotations.length; ++i ) {
                var rotation = {
                    order: rotations[ i ].order,
                    x: nearestAngle( baseRotate.x, rotations[ i ].x ),
                    y: nearestAngle( baseRotate.y, rotations[ i ].y ),
                    z: nearestAngle( baseRotate.z, rotations[ i ].z )
                };

                var score = Math.abs( rotation.x - baseRotate.x ) +
                    Math.abs( rotation.y - baseRotate.y ) +
                    Math.abs( rotation.z - baseRotate.z );

                if ( !i || ( score < bestScore ) ) {
                    bestScore = score;
                    bestRotation = rotation;
                }
            }

            return bestRotation;
        }
Given a base rotation and multiple rotations, return the best one.

The best one is the one has least rotate from base.