Screen space position of a vertex in python



  • Hi,
    I'm trying to write a python script to retrieve the screen space location of a given vertex of an object. I'm using a dolly camera. I can get the vertex position in the world coordinate system using body.Geometry().WorldVertex(i), but not exactly sure how to get the screen space coordinate. I could potentially manually build the camera matrix based on its parameters and project the points, but I wonder if there's an easier way.
    Thanks.



  • @vkazemi will this do the job?
    0_1558007141976_Screen Shot 2019-05-16 at 9.44.42 pm.png



  • This post is deleted!


  • @anomalaus I tried this and it seems it only works for the preview camera. When I set output resolution of the scene with scene.SetOutputRes() it doesn't seem to adjust for the difference between the output and preview. Is there a work around?