From: Brian Furtaw (brian++at++sgi.com)
Date: 10/04/2000 08:59:53
Mark,
The easiest way to get started with ASDs assuming you have a regular
spaced grid of heights, is to use the pfdBuildASD function. It returns
an ASD which you can attach to your scenegraph and view. Good examples
which use pfdBuildASD are in
/usr/share/Performer/src/pguide/libpf/C/build*.c. The env var
PFASDLODSIZE controls how many LODs are built by pfdBuildASD, keep it
below 8 for good performance. At a value of 9 you wait a bit for the
database to get built. You also need to know that forking off the
compute process moves some of the ASD overhead on to another CPU. Or
PFMP_FORK_COMPUTE on to your pfMultiprocess call arguments. The beauty
of the ASD is that only the polygons that are in the viewing frustum are
sent to the pipe for rendering. The ASD compute takes care of culling to
the view volume for you. ASDs can also page in terrain data from disk
while you traverse your data. This lets you have ASDs that are much
bigger then your systems memory, just like cliptexturing. Speaking of
cliptexturing ASDs can help you their too. The ASD will compute Clip
rings from the terrain data and set your Cliptexture Virtual Params for
you.
Concerning building your own ASD you should read chapter 15 in the
"Performer Programmers Guide". There are three data structures that are
used to describe an ASDFace or triangle and its attributes for each LOD.
You build each LOD based on its ASDfaces and the ASD takes care of
morphing in between them. You can also specify the evaluation function
to determine which LOD to sample ASDFaces from. The default evaluation
function is based on the distance from the observer. The other big
consideration with ASDs involves the placement of models on the morphing
terrain. You don't want cars or buildings to be floating in space off in
the distance. Their is a pretty good description of using pfFCS's and an
Alignment pfEngine to keep objects on the ASD terrain. I won't say that
after you read the ASD chapter in the programmers guide that you know
everything, I sure didn't, but it gets you started. Also checkout
/usr/share/Performer/src/pguide/libpf/C/simpleASD.c and ASD_align.c.
To use the data in your 3ds files pfdLoadFile("terrain.3ds") to load the
file then extract the data to build the ASD from the Performer
scenegraph, the pfGeoSets. The examples I listed above builddem.c and so
forth do this from dem files. If you can build regular grids once you
extract the vertices you can use pfdBuildASD(). If you have irregular
grids as far as I know you have to write some code to build the ASDs.
So again build your irregular grids programmatically. If you have
Multigen Creator they have their own implementation of ASDs called CATs
for Continuously Adaptive Terrain and that might help you build
irregular CATs. Can someone else comment on the capabilities of the
Multigen CATs?
Brian
Mark Gill wrote:
>
> Greets,
>
> I'm trying to create a large-scale terrain vis, so pfASD is the obvious way
> to go. I have some (what seem to be) pretty basic questions about pfASD:
>
> How can I construct a pfASD node -- is it the same as assembling an LOD
> structure?
>
> Will I be able to use polygon meshes generated from a CAD/3d modeling
> package such as Lightwave, or 3d Studio? (I will probably go .3ds -->
> .iv --> .pfb)? If so, can someone please point me to a code sample that
> demostrates how this is done?
>
> I saw some discussion from a few years back about pfASD requiring regular
> grids/height fields. Is this still the case, or will I be able to work with
> irregular polygon meshes? the Perf. Prog. Guide seems to indicate that
> irregular polygon meshes can be used, but it doesn't say how.
>
> Thanks a bunch.
>
> Mark Gill Visualization Researcher
> CHL Stennis Space Center
> Mark.Gill++at++usm.edu
> ----------------------------------------------
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
--
----oOOo---- ----oOOo---- ----oOOo---- ----oOOo----
Brian Furtaw (brian++at++sgi.com)
Graphics Guru Office:(301)572-3293 Fax: (603)250-0370
12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision
Silver Spring, Maryland 20904 Volumizer/Optimizer/React/PCI Device
Drivers
This archive was generated by hypermail 2b29 : Wed Oct 04 2000 - 09:09:07 PDT