How to project a texture on a surface/terrain?

You may also want to look into this thread that shows how to do decals on a mesh: Spray/Decal Script