Re: Putting attr list into geosets

New Message Reply Date view Thread view Subject view Author view

Sharon Clay (src++at++rose.asd.sgi.com)
Wed, 22 Jan 1997 10:07:22 -0800


+>---- On Jan 22, 10:54am, Nicolas Gauvin wrote:
> Subject: Re: Putting attr list into geosets
->From guest++at++holodeck.csd.sgi.com Wed Jan 22 08:50:17 1997

->
->You shouldn't need to call pfGSetAttr again to put the list back.
->pfGetGSetAttrLists gives you the pointers to the actual list, not a copy of
->them. Once you have the pointer, simply modify its content and thats it. The
->geoset will be aware of the changes.

We will use the new data for drawing but we will not automatically
compute new isect or culling bboxes cached on the gset. So,
You may want to fix a bbox statically that is big enough to hold
the possible transformed values with pfGSetBBox (also the safest/most
efficient thing to do with the MP cyclebuffer soln.) or else force the bbox to
be recomputed with a NULL box to pfGSetBBox() or the full
icset cache with pfGSetIsectMask() (yes, we need more direct API for that).

src.

->
->However the safest way to do this sort of thing is to use a pfCycleBuffer
->for the attribute list you intend to modify. This way you will be frame
->accurate when multiprocessing.
->
->The man page of pfCycleBuffer contains a simple example for this:
->
-> pfVec3 *prevVerts, *curVerts;
->
-> pfInit();
->
-> pfMultiprocess(mpMode);
->
-> /*
-> * This calls pfCBufferConfig() with the number of buffers
-> * appropriate to the multiprocessing mode.
-> */
-> pfConfig();
->
-> verts = pfNewCBuffer(sizeof(pfVec3) * numVerts, pfGetSharedArena());
-> pfGSetAttr(gset, PFGS_COORD3, PFGS_PER_VERTEX, verts, NULL);
->
-> while(!done)
-> {
-> curVerts = pfGetCurCBufferData(verts);
->
-> /* Compute new positions of mass-spring system */
-> for (i=0; i<numVerts; i++)
-> curVerts[i] = prevVerts[i] + netForceVector * deltaTime;
->
-> /* Indicate that 'verts' has changed */
-> pfCBufferChanged(verts);
->
-> prevVerts = curVerts;
->
-> /* This calls pfCBufferFrame() */
-> pfFrame();
-> }
->
->--
->Nicolas Gauvin CAE Electronics Ltd., 8585 Cote De Liesse
->Software Developer Saint-Laurent, Quebec, Canada, H4L-4X4
->3-D Graphics Applications tel: +1 514 341 2000 extension 2275
->nicolas++at++cae.ca fax: +1 514 340 5496
->=======================================================================
->List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
-> Submissions: info-performer++at++sgi.com
-> Admin. requests: info-performer-request++at++sgi.com
->
+>---- End of excerpt from Nicolas Gauvin

-- 
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
Sharon Rose Clay (Fischler) - Silicon Graphics, Advanced Systems Dev.
src++at++sgi.com  (415) 933 - 1002  FAX: (415) 965 - 2658  MS 8U-590
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:26 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.