Python: Convert a point into camera-space (BGE)
The camera_to_world and its inverse world_to_camera transform matrices provide the simplest way to convert between camera and world space. However, the more difficult part is accessing the vertices in the game engine.

Getting vertices in the game engine requires three nested loops. First, loop through a game object's meshes, then loop through each mesh's materials, and finally get a VertexProxy for each index in the material. With the XYZ property on the proxy, we can multiply the world to camera transformational matrix by the vertex position to get the vertex in camera space coordinates.

After processing the vertex, multiple the camera to world matrix by the vertex and assign it to the XYZ property on the proxy.

import bge

scene = bge.logic.getCurrentScene()

camera = scene.cameras["Camera"]
cube = scene.objects["Cube"]

for mesh in cube.meshes:
    for material in mesh.materials:
        for i in range(mesh.getVertexArrayLength(material.material_index)):
            proxy = mesh.getVertex(material.material_index, i)
            vertex = camera.world_to_camera * proxy.XYZ

            #process vertex in camera space

            proxy.XYZ = camera.camera_to_world * vertex