Level Of Detail in VRML

Introduction

There is a need in some VRML worlds to remove/simplify objects which are long distances away or not visable at the time. The usual method of reducing the number of objects which are displayed in a scene at a time uses the LOD command. This command allows several versions of an object to made and displayed according to how far away the object is from the viewpoint.

Discussion of the problems

The method using LOD is good but has a few limitations. For example if there were two rectangular rooms side by side you would want to remove every thing from the room you aren't in at the time.

Examples and code

LOD {
 center 0 0 0
 # where the center is which is used for LOD calculations
 # you often need to play round with this so it is centered
 # in the middle of the object
 range [ 10 ]
 # distance values (measured from center above)
 # always one value less than the number of levels
 level [
  # any number of Group or Transform nodes
  # which themselves function as levels of detail
  # for example:
  Group {
   children [
   # level 1 geometry
   ]
  }
  Transform {
   children [
   # level 2 geometry
   ]
  }
 ]
}

The code is fully documented so notes should not be needed
LOD example