We have been experimenting with laying paths and roads on top of our
terrain.
Examples:
http://www.cosm-game.com/screenshots/cosm345.jpg
http://www.cosm-game.com/screenshots/cosm347.jpg
We build an articulated triangle strip by applying bezier curves to a series
of path nodes, then flattening the curves by sub-dividing, then turn them
into a series of equally spaced nodes at a certain density, then finally
turning that into a triangle strip.
We do this for a number of reasons, the primariy one being that we can apply
a higher density texture to the path than we use for the terrain. This also
allows us to "flow" a texture along the path, such as stone or brick.
The height of each point in the path mesh is retrieved from the heightmap
source. Laying it over the terrain has some issues. The first one is that
the path mesh is actually more accurate than the terrain mesh, since the
terrain is rendered with a lower density and has slight errors due to edge
collapsing we do to reduce polygon count.
This means that the path sometimes dips below the ground.
1. I have tried adjusting the polygon offset and offset factor to give the
path zbuffer precedence but this didn't seem to do anything.
2. The path mesh has alpha blended edges, so I don't think I can Decal it on
top of the terrain, not to mention that the terrain is in chunks and I would
have to break up the path and attach the segment to each chunk. If I did do
that, how exactly is decal implemented? The documents say that decals have
to be coplanar, then say they dont guarentee there will be no zbuffer
collisions... which makes no sense to me. What blend modes are supported
with Decals?
3. I tried disabling zbuffer reads for the path, and this works fine as long
as you are looking down the path, but if the path loops around the hill you
now see it through the hill.
4. I tried adding an arbitrary Y addition to deal with the terrain
discrepencies, and this produced the best results, but still far from
perfect.
Does anyone have any suggestions?
Dave Yazel
Cosm Development Team
http://www.cosm-game.com/
===========================================================================
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".