|
From: Dair G. <da...@re...> - 2004-06-28 22:07:40
|
Jose' Cruanyes wrote:
>first approach, just to introduce the discussion...
>
>groups inside a LOD group
>each group with bounding box/sphere
>each group has some sort of minimal requirements (area of projection in=20
>pixels, distance from POV, minimum angle, moon phase, you name it)
>and the submit loop inside the LOD group choose wich one to submit...
>
>This Switcher group can be also handy to texture and other types of=20
>animation, suffice to change the criterion used to choose which=20
>subelement to submit...
Yes, calling it an "LOD group" is really a misnomer: it's more a
"dynamic group".
So interface is something like:
-----------------------------------
typedef TQ3Object (*TQ3XDynamicGroupSelectorMethod)
(TQ3ViewObject theView,
TQ3GroupObject theGroup)
Q3_EXTERN_API_C ( TQ3GroupObject )
Q3DynamicGroup_New (
void
);
Q3_EXTERN_API_C ( TQ3XDynamicGroupSelectorMethod )
Q3DynamicGroup_GetSelector (
TQ3GroupObject theGroup
);
Q3_EXTERN_API_C ( TQ3Status )
Q3DynamicGroup_SetSelector (
TQ3GroupObject theGroup,
TQ3XDynamicGroupSelectorMethod theSelector
);
-----------------------------------
A dynamic group is a subclass of a display group, which has the
following behaviour:
1. The group can have a selector function associated with it.
2. When a dynamic group is submitted to a view, it invokes its selector
function (if any).
3. The selector is passed the view, the group, and any other state?
4. The selector returns the object to submit to the view. The object to
submit must be contained within the dynamic group.
Don't know: that gives you the basic building block, but means you have
to implement "get the distance to the camera" and "get the bounds of the
objects" and "pick an appropriate object based on distance".
All of which are doable, but perhaps there's scope to layer some kind of
LOD group on top of this object to make that easier?
Not sure what the best approach for that is - the way I did it was
purely on the distance from the center of some object to the camera, and
with appropriate units for my situation (i.e., I didn't care about
bounding volumes, as I just needed a far/medium/near transition).
-dair
___________________________________________________
mailto:dair+refnum.com http://www.refnum.com/
|