1. A method for painting an object, said method comprising the steps of: arranging a painting head in a predetermined working area, said painting head equipped with at least one spraying nozzle arranged to deliver a flow of paint on a surface of an object; moving said painting head in said working area, said moving being carried out by moving means having at least two degrees of freedom; identifying the three-dimensional shape of said surface of said object, said identifying step comprising the steps of: projecting a grid, or matrix, of infrared points on said surface of said object, obtaining a projected image comprising a plurality of points; detecting said projected image obtaining a detected projected image comprising a plurality of points, or pixels, having determined spatial coordinates, said detecting step carried out by optical sensor means integral to said painting head; processing said detected projected image, said processing step arranged to determine said spatial coordinates of each of said points of said detected projected image in order to determine the three-dimensional shape of said object, said spatial coordinates x, y being determined on the basis of the position of each point, or pixel, in the detected projected image, said processing step comprising a step of converting said three-dimensional shape in a two-dimensional geometric shape of said surface of said object, said converting step being carried out computing the grey-level values of said points, or pixels, of said detected projected image; moving said painting head in said working area on the basis of said spatial coordinates of said points in such a way that during said painting step, said spraying nozzle is arranged at a substantially fixed distance from said surface of said object and can follow its curvature.