Mingtian Ni wrote:

Hi all,
For those geometries which are compact, DistanceLOD works
fine. But it doesn't work well for elongated objects.
Has anyone implemented a LOD class based on the distance between
the eyepoint and the bound (especially Box bound) of an object?

The way we do it in Xj3D is to build our own LOD system. To start with,
you need some behaviour that is going to trigger each frame. In this
behaviour, you then do a pick using a point. The point represents your
avatar in virtual space. For your structure that you want to control as
LOD you then build something like this:

                 Group
         +---------+----------+
      Switch                Group
        /|\             +------+------+
     Geometry         Big     Med    Small
       for           BBox    BBox    bbox
     each range

Under the switch is the geometry that you use for each of the ranges.
The switch controls what is visible. Turn picking off on this branch. On
the other branch is a collection of geometry that represents the various
range bounds. Make sure the appearance sets them to invisible. Next,
make use of the UserData to give you some information to refer back to
the appropriate piece of geometry that that box refers to - you're
obviously going to have more than one LODed object in the scene and the
picking just gives you the picked item, not the structure it refers to.
Your point pick returns you a collection of these boxes and you can tell
based on the box ID which object and which range you are at, and then
set the switch appropriately to show the correct range.

--
Justin Couch                         http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler              http://www.yumetech.com/
Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
                                              - Greg Bear, Slant
-------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to