Error 404 - Not Found
Sorry, the page that you are looking for does not exist.
VRML Script Tutorial Full list VRML Interactive Tutorial
Introduction
Hierarchical Node Structures
Defining and Instancing Nodes Defining Levels of Detail Events in VRML
|
Lighthouse3d.comMostly about 3D graphics
Error 404 - Not FoundSorry, the page that you are looking for does not exist.
|
|
In it you see three cones. The left one which isn't really a cone, more like a pyramid, has only four sides, the middle one has 8 sides, the right one has 16 sides. These cones were created using Extrusionnodes.
You can see that they are different by the way they reflect light. Now look at the next figure.
The above figure includes the same three cones but placed further away from the user. It is becoming difficult to distinguish between the right and middle cones, although you can still clearly see the difference between the left cone and the other two.
In the above figure the user is further away from the cones than in the previous figure and as a result it is harder to distinguish which is the more detailed, and the less detailed cone.
This sequence of images shows that with distance the perception of the details in an object becomes harder. This is the reasoning behind the LOD node. Why draw very complex shapes when they are too far away from the user for details to be recognized? The more complex a shape is the more demanding is the task of drawing it. If an object is far away there is no benefit in drawing the object full of detail.
The LOD node can be used in the following way:
The LOD can also be used to avoid drawing objects which are invisible, for instance in another room. In this case one can specify an empty object, for instance a Shape without a geometry.
The range field specifies which version of the object is drawn. The objects should be specified in the level field by decreasing level of detail. If the distance from the user to the object is smaller than the first range specified, then the first version, the more detailed, will be drawn, if the distance is between the J-1 and J ranges, then the Jth version is drawn. If the distance is greater than the last range specified, with an index I, then the Ith version is drawn.
The main problem is knowing how much is "close", "not to far away", and "very far away". This is perhaps something the browser developers should think about, providing coordinates for the user's position.
If browsers did provide the user's position then one could have the several versions with different levels of detail of the object drawn at the origin, then the user would move away from the objects until no difference was perceived between the full detailed version and a slightly less detailed version. The user's position could then be used to compute the distance when the level of detail should be changed. This procedure would be repeated for all levels of detail until all versions looked the same.
Unfortunately most browsers do not provide the user's position so it becomes a matter of trial and error.
Source code exemplifying the use of a LOD node:
#VRML V2.0 utf8 LOD { range [20,40] level [ #full detail 16 sided cone Shape{ appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 } } geometry Extrusion{ crossSection [ -1 0, 0 0, -1 -2 -1 0] spine [1 0 0 , 0.866 0 0.5, 0.5 0 0.866, 0 0 1 , -0.5 0 0.866, -0.866 0 0.5, -1 0 0, -0.866 0 -0.5, -0.5 0 -0.866, 0 0 -1 , 0.5 0 -0.866, 0.866 0 -0.5, 1 0 0 ] } } #intermediate detail 8 sided cone Shape{ appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 } } geometry Extrusion{ crossSection [ -1 0, 0 0, -1 -2 -1 0] spine [1 0 0 , 0.707 0 0.707 , 0 0 1 , -0.707 0 0.707, -1 0 0,-0.707 0 -0.707, 0 0 -1 , 0.707 0 -0.707, 1 0 0 ] } } #low detail 4 sided cone Shape{ appearance Appearance { material Material { diffuseColor 1.0 1.0 1.0 } } geometry Extrusion{ crossSection [ -1 0, 0 0, -1 -2 -1 0] spine [1 0 0 , 0 0 1, -1 0 0, 0 0 -1 , 1 0 0 ] } } ] }