Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / ComputeWorldToScreen IsBoundingBoxInView
  RSS 2.0 ATOM  

ComputeWorldToScreen IsBoundingBoxInView
Rate this thread
 
50571
 
Permlink of this thread  
avatar
  • John McC
  • Posted: 16 December 2010 09:05 PM
  • Location: Sydney, Australia
  • Total Posts: 41
  • Joined: 05 December 2007 04:30 AM

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.



Replies: 0