How to project 3D data into pixel coordinate?

Also note that when using the pinhole camera model, multiple points can
correspond to the same pixel, so you might have to do a z buffer check
(only keep the closest pixel).