# Estimating rendered model size given dist, radius and projection matrix

This topic is 3348 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi there, I need help figuring out how to estimate the rendered size of a model. I'll use the bounding sphere surrounding the model as an approximation. It has a 3-d vector for it's center position and a float representing the sphere's radius. I have a 3-d projection matrix computed using the standard FOV matrix computation, and I can compute the distance from the center of the model to the camera using: distToCamera = vector length (model center - camera center) Not sure how to estimate how large in screen space pixels the model will likely be rendered at? I have the z-near and z-far data handy as well. Any help or links to Google would be appreciated. Thanks!

##### Share on other sites
Hi,
You probably want to give a look onto
gluProject

##### Share on other sites
Thanks I actually want to estimate the size of the model after the projection so I can cull it if it's too small. I'm using DirectX and could use the alternative D3DXVec3Project() (or probably just vector-matrix multiply the center of the bounding sphere by the world-view-projection matrix myself), but I still don't understand how to figure out how big the transformed object will be?

##### Share on other sites
You might be interested in this thread from a while ago.

##### Share on other sites
Calculate a scissor rectangle from bounding box points projected to screen... And use width & height to determine what you need.

Okay, I can give you some code tomorrow, its for lights, but will work for models as well.

##### Share on other sites
Thanks for the replies guys,

What I'm trying now is projecting the bounding sphere center and a point along the radius to screen space then subtracting the two vectors and taking their length and using that as the estimated screen space radius of the projected model.

EDIT: Worked great, will rate up all who replied thx!

##### Share on other sites
Unless the object is particularly elongated (e.g. a needle), you can probably do this based on the radius of the object.

Then, your size (linear, not area) will always be:

where k is some constant of proporitionality, which would be a function of the projection. Figuring out the specifics for the constant is a bit more complicated, however.

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633661
• Total Posts
3013219
×