So, I've been scripting with python in maya for a while, but this is my first foray in to maya api business, so I've cobbled together a handful of stuff that works to a certain extent and I'm having trouble finding the next piece...
I'm trying to calculate the camera frustrum values for a camera, which is working but only for the camera with no transform. I've taking bits and pieces of code from a plugin that used an MPxLocatorNode to draw with openGL the camera frustrum as lines using the near and far clipping planes and the focal length. etc.
I've cobbled together a plugin that gets the necessary info from the camera and returns the points such as top right near and far and so on, but my problem is the original plugin would rotate with the camera, but mine only calculates the info from the camera not with the transorms. I need to incorporate the cameras world transform matrix, I'm guessing... I'm a total noob at this and am trying to learn as best I can and need some direction on how to combine my frustrum data with the rotation of the camera. I've attached the code, it will run as a plugin. with the mel createCustomLocator;
can someone give me some hints on how to proceed, I know i'm missing a lot, but I want to learn?
tl;dr, I need help with getting my calculated frustrum points to rotate with my camera.