How to get the Projection Matrix

Okay, i want to get the projection matrix of the current camera in order to project some points of the scene by myself and render them with my own methods…the problems are :

  1. i always get an identity matrix with the MFnCamera::projectionMatrix method
  2. in fact, i always get an identity matrix whenever i want to retrieve a transformation matrix of an object or of anything else
  3. i don’t know how to link the projected points in the 3d world to the 2d image and the pixel coordinates.

If someone could at least tell me why i don’t get the projection matrix, that would be great ! thanks !

Hi lordabdul,
Have you tried using the API call M3dView:worldToView()?
It takes in a MPoint (which basically is x,y,z) and return the x,y with respect to the current viewport. I have tried it and it works fine. Do email me if you needed more details. eddie_chew@yahoo.com