Scott McMillan (scott++at++ht.com)
Mon, 11 Nov 1996 13:00:47 -0500 (EST)
----
The latest on the reindexing saga:
Okay, so I have a function that, given a node in a scene graph, will traverse
the tree below it and find all of the pfGeoSets. For each geoset it will
1) add the vertices to a single vertex list (also provided in the fcn call)
throwing away any redundant vertices (based on proximity to other
vertices in the data)
2) as it adds vertices to the list or finds existing vertices, will build
the index list for the vertices, and assign the resulting i_list to the
GeoSet PFGS_COORD3 attribute. It does not assign the "global" vertex
list yet as it may be pfRealloced as additional GeoSets are visited and
may move around in shared memory.
Ignore the fact that I do not account for preexisting indexed geosets,
for now.
3) it also adds indexes the color, normals, texture coords (b/c if one is
indexed they all have to be indexed, right?) by leaving the attribute
arrays in place and creating a simple consecutive index list:
i_list[i] = i, for i=0,...,num_attributes-1
4) after (1 - 3) have been done for all the GeoSets, it revisits all of them
and sets the PFGS_COORD3 attribute list to the single global list and
pfFrees the old one.
When this is done I save it out as a pfb file and look at in perfly....no
problem.
BUT, when I try to pfPrint the scene rooted at the specified node:
pfPrint(model, PFTRAV_SELF|PFTRAV_DESCEND, PFPRINT_VB_DEBUG, NULL);
it starts to dump the list of indexed coords AND normals (color is
PFGS_OVERALL, and texture coords are PFGS_OFF for now). It prints them all
out just fine, but then it keeps going...past the end of the list for the
first geoset and starts printing garbage coords and normals....it doesn't
seem to know when to stop. The output for the first GeoSet is below.
Note that there are 507 vertices and normals and Normal Index: 506 indicates
the 507th entry and that is where it should stop. The index values after it
are bogus...
I have also loaded and pfPrinted the pfb file that was created and I get the
same result.
Is there a bug in pfPrint, or am I missing something in my redefinition of
the GeoSets?
scott
--------
[0:0]pfGroup pfId=159 0x18178e90 {
path: /trachea_sp.iv
trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
bsphere: ctr(0.092511, -0.094940, 0.050358) rad=0.121025
Num Children: 26
[1:0]pfGeode pfId=160 0x18099e10 {
trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
bsphere: ctr(0.048237, -0.024314, 0.019852) rad=0.030230
Num pfGeoSets: 1
[2:0]
GeoSet: 0x180fffe0 {
Primitive: PFGS_TRISTRIPS, INDEXED, pfPrims=118, glPrims=271, verts=507
Attribute Bindings:
PFGS_COLOR4=PFGS_OVERALL PFGS_NORMAL3=PFGS_PER_VERTEX PFGS_TEXCOORD2=PFGS_OFF
Attribute List Pointers:
PFGS_COORD3: 0x180a2980
PFGS_COLOR4: 0x180c6d90
PFGS_NORMAL3: 0x18092d00
PFGS_TEXCOORD2: 0x0
Attribute Index List Pointers:
PFGS_COLOR4: 0x1807a880
PFGS_NORMAL3: 0x1817d5f0
PFGS_TEXCOORD2: 0x0
PFGS_COORD3: 0x1816b0f0
Strip Lengths: 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4
4 6 7 5 6 8 6 5 5 6
5 5 6 8 10 7 5 5 12 6
7 5 7 10 5 15 5 11
, Overall Color Index: 0 R: 0.800000 G: 0.800000 B: 0.800000 A: 1.000000
Coord Index: 0 X: 0.053633 Y: -0.004029 Z: 0.015874
Normal Index: 0 NX: -0.550077 NY: -0.607613 NZ: -0.572906
Coord Index: 1 X: 0.051288 Y: -0.002053 Z: 0.015561
Normal Index: 1 NX: -0.812781 NY: -0.525648 NZ: -0.251160
Coord Index: 2 X: 0.052676 Y: -0.001747 Z: 0.014397
Normal Index: 2 NX: -0.442878 NY: -0.416817 NZ: -0.793802
:
:
[snip]
:
:
Coord Index: 133 X: 0.058036 Y: -0.013689 Z: 0.026243
Normal Index: 504 NX: -0.802027 NY: -0.533556 NZ: 0.268462
Coord Index: 114 X: 0.057385 Y: -0.013675 Z: 0.024722
Normal Index: 505 NX: -0.836338 NY: -0.492077 NZ: 0.241659
Coord Index: 113 X: 0.059613 Y: -0.015237 Z: 0.025372
Normal Index: 506 NX: -0.614704 NY: -0.766679 NZ: -0.185317
Coord Index: 3778 X: -0.234370 Y: 0.381766 Z: 0.875715
Normal Index: 6082 NX: -0.036369 NY: 0.027931 NZ: 0.087813
Coord Index: 15891 X: 0.037035 Y: 0.038787 Z: 0.030086
Normal Index: 15634 NX: -0.226442 NY: -0.670342 NZ: 0.494637
Coord Index: 41762 X: 0.000000 Y: 0.000000 Z: 0.000000
:
:
:
-- Scott McMillan | HT Medical, Inc. | Developing virtual environ- scott++at++ht.com | http://www.ht.com | ment medical and surgical Ph: 301-984-3706 | 6001 Montrose Rd., Ste. 902 | simulations and surgery Fax: 301-984-2104 | Rockville, MD 20852 | simulation creation tools.======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:55 PDT