Camera GetExtents

Camera GetExtents

Anonymous
Not applicable
610 Views
1 Reply
Message 1 of 2

Camera GetExtents

Anonymous
Not applicable

How does Camera.GetExtents work?  I'm trying to use it for a custom picking algorithm, but the numbers it returns are not what I expect.

 

From a front orientation, the numbers are correct, and remain correct as I rotate the camera.  But if I do a zoom all, the width and height become something completely different. 

 

I would expect the width and height to represent the width and height of the view frustum in orthographic mode, but this is not the case as the numbers clearly do no represent the aspect ratio of the screen.

 

Even if I manually zoom to the object until it is close to the zoom all result, call GetExtents, then zoom all (the zoom barely changes) and do another GetExtents, the results are totally different.

 

Are there any known issues with this function?

0 Likes
Accepted solutions (1)
611 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

I can calculate the extents manually by taking the left and right screen coordinates, converting them to world coordinates using ViewToModelSpace, projecting them onto a plane facing the camera, and measuring the distance between them.

 

It appears the GetExtents function is broken, unless I am misinterpreting the help file, and the function is not supposed to do what I think it does.