IndexedFaceSet for height fields, essentially a patch [»]
IndexedFaceset (IFS).
Kind of like a 3d connect-the-dots, you specify a series of points in space,
and tell the vrml browser how you want them connected into polygons.
Implicit in the order of connections is the polygon normal,
which defines the inside and outside faces of the polygons.
Coordinate{} node for the coord field of the IFS,
and specify vertices in its point field. Define polygon face loops
in the coordIndex field of the IFS, referring by index numbers
to the vertices in the Coordinate node. Close the loop with a -1.
IndexedFaceSet {
coord Coordinate {
point [
-1.73 -1 0 # index 0
1.73 -1 0 # index 1
0 2 0 # index 2
]
}
coordIndex [ 0 1 2 -1 ]
}
|
![]() |
if you want the surface normal of the poly to point towards you,
then define the vertices in counter-clockwise order (remember the right hand rule).
Some modelers specify their polygon vertices in the opposite order;
the ccw flag allows you to flip the normals for an entire IFS.
Using the default ccw TRUE saves the browser some effort by delivering vertices in the expected order.
solid TRUE lets browser take a short cut and
only render one side of the poly. Viewed from the back, the poly is invisible.
creaseAngle
field of geometry nodes to control the 'facetedness' of the geometry.
It doesn't change the geometry, just the threshold for making sharp distinctions between faces.
The vrml browser compares the normals of two adjacent faces, and if the angle
between them is less than the value specified for creaseAngle, then
they are shaded together in a continuous tone. Otherwise, there is a shading change
at the edge between them. Crease angles are specified in radians.creaseAngle values [»]
IFS [»]
xDimension x zDimension height values:
ElevationGrid {
xDimension 5
zDimension 6
height [
.0 .2 .4 .2 .0
.0 .2 .4 .2 .1
.1 .4 .5 .2 .2
.2 .3 .5 .3 .1
.1 .2 .3 .1 .0
.0 .1 .2 .1 .0 ]
}
For complex terrain, sometimes it's easier to draw a height field as an image
and convert it to an elevation grid. [»]
Text{} : the copy itselfFontStyle{} : the formatting characteristics
task03 [»]