Find 3D point projection in rendered image.

Hi everyone,

I need to find out locations of some facial points (nose tip, eyes, etc) in final rendered image.

I found that I can access character mesh by using node.getSkeleton().getObject().getCachedGeom() API. I want to find out indexes of interesting points in the mesh, however I can't find any way to show the indexes.

I managed to find out some of the points by iterating through the mesh and placing sphere at vertex's location, but this is very unconvinient and time consuming task. Is there a better alternative?

Is there some API to find out location of these points at final image or at least to get projection matrix of the camera?

Comments

  • pavelbpavelb Posts: 0

    I found that I can use Geometry Editor tool to select vertices and find out their indexes at details tab, so one problem is solved.

    I didn't find any API to do the projection, so I decided to do the mathematics by myself. One of the required parameters to calculate projection matrix is camera FOV. I used getFieldOfView of camera object to get it. Surprisingly, however, returned FOV is different from the observed FOV. To test FOV (observed) I put small sphere object at the edge of the frame, get it location and find FOV (horizontal) using this formula FOV = 2 * atan(x / z).

    When I calculate FOV from camera parameters using following formula Math.atan(oCam.frameWidth / 2 / oCam.focalLength) * 2, I receive value same to the one returned form getFieldOfView API.

    For camera with frame width 36mm and focal length 65mm returned (and calculated) FOV is 30.96 deg, while observed FOV  is 40.61 deg.

    Am I missing something?

  • pavelbpavelb Posts: 0

    I have managed to fit the results (correctly find location of the object in the frame) by dividing object's z value by factor of 4/3.

    However I am still can not understand why should I do this division.

    Am I missing something?

Sign In or Register to comment.