Heya gents, thanks for working so hard on that solution Mango, I'll
have a good look through it this afternoon. As you mentioned above,
after a morning of digging through the source I managed to figure out
that the contents of the session.container object report their bounds
as being flush with their edges, not the entire view. I'll post the
code here for anyone who should come looking:
Here's a way to use the Session object within your View3D to find the
bounds of an object you've drawn to the screen with view.render().
This example is built for a single object, in my case an imported OBJ
file. The coordinates returned are relative to (this), the movie
within which the view object is contained.
// view has been defined previously, it's our View3D object.
var sessionContainer:DisplayObjectContainer =
view.session.getContainer(view) as DisplayObjectContainer;
var drawnObject = sessionContainer.getChildAt(0);
var viewBounds = drawnObject.getRect(this);
trace("vb: " + viewBounds.left + "," + viewBounds.top + "/" +
viewBounds.right + "," +viewBounds.bottom);
The next challenge is to find a way to wait until the view has been
successfully rendered. Right now I'm using onEnterframe and I think
it's lagging a frame or two behind.