Hello Iīm searching for an efficient algorithm for level of detail selection.
As I understand it there are basically two ways to do it.
1. The distance from the object to the point of view in word space.
2. The size in pixel of the object in screen space.
The first way should be simple to calculate. I think the only problem is which point to take for the calculation of the distance the center of the object or the nearest point of the bounding box.
The disadvantage of this way is that you donīt know how large the object will be on the screen. This will depend on the size of the object resp. on the size of the field of view. So when you zoom into the scene and change the field of view the distance of the object wonīt change but itīs size on the screen.
The second way I think would be the best because you can select the level of detail depending on the size in pixel on the screen. This would be the most naturall way and you are independent of the field of view of the camera.
The problem I have is how to efficiently calculate the screen area of the object resp. its bounding box. You have to test all the 8 corners of the bounding box and take the min/max-values to calculate the screen space area. I think this would be very expensive especially when you have a lot of objects in your scene. You can use gluProject but how expensive is this?
Did anyone knows a good way to do this or a good algorithm maybe with sourcecode?
Thanks in advance