Need Help with Projection 3D-Points into Camera-Image

I’m trying to write a python script [please no “click on bla” answer ;)] that computes the Pixel Coordinates for a 3D-Point (for example the center of a sphere “ob_sph”).

[Even better would be the other way round, but a 2D-Point is represented by a ray in 3D.]

I searched a lot in this (and other) forum and found different ways to compute the corresponding projection matrix from the camera in blender, but not one of the projection matrices did its job right.
Eighter it just works with point like (x,y,0) or not right for me at all.

Do you have any idea where I could find the searched matrix or how I could get to it another way?

The python version and blender version are not important for me, I allready worked with blender 2.49b and also with 2.56.

PS: Blender GameEngine is NO solution for me, because this script should run backgrounded.

Thanks for any help!

any ideas?