How do I find the projected size of a mesh?

Started by
3 comments, last by Key_C0de 3 years, 4 months ago

I've been browsing around gamedev website, searching for a decent way to change between mesh lod's.

I found a promising answer by eq to LOD determination - Graphics and GPU Programming - GameDev.net where he talks about the “projected size” of a mesh. Other answerers talk about it too.

But I can't find out how to calculate it.

It's basically the distance between the camera to an object, adjusted for the size of the object's AABB bounding box and possibly fov.

I know how to calculate aabb, fov and distance, but I do not know the relationship between them to form the projected size.

Anybody knows how to calculate it and willing to share I'd appreciate.

None

Advertisement

i assume u haven't seen Mitton's notes: http://www.codersnotes.com/notes/projected-area-of-an-aabb/

But hang on! Before u click on the link!

Remember this:

float objectArea = projectedArea( ... );

ok u can click on the link now ?

@ddlox You the best man. Thanks.

None

It's a little strange that he uses HLSL to calculate projected size and not C++.

You can't pick and choose different lod in hlsl, you can only deal with individuals vertx or pixels.

But I suppose he used hlsl code for demonstration.

Anyway.

None

This topic is closed to new replies.

Advertisement