|
Hi,
I am trying to do some frame culling when objects are off screen. However I can’t seem to put the right numbers into the compute world to screen method on a camera.
I have the inverse of the global camera transform for the world to camera, but the pixel width/height eludes me. The cameras are all fixed resolution set to 1280x720, however the camera always returns back 320x200 for the aspect width and height. I tried getting values from the aperture of the camera but that would return back the identity matrix (which is an error return). 1x1 returns back the identity matrix again. How do I get those values from the scene?
A fixed value of 1280x720 appears to return a sensible WorldToScreen matrix, however the BBoxes report sometimes to be off screen (even though they are not). I have checked those BBs and they appear fine. Anyone managed to get this all to work consistently and correctly?
Note: It appears you can’t simply just use the inverse of the global transform of the camera in the bounding box test as the docs suggest, since if the camera has an interest or roll this matrix doesn’t appear to take them into consideration. I have managed written the required method to solve this however.
Cheers.
|
|
|