Re: Extracting from pfGeoSet

New Message Reply Date view Thread view Subject view Author view

From: Alexandre Naaman (naaman++at++laplace.engr.sgi.com)
Date: 02/28/2001 09:34:05


On Wed, 28 Feb 2001, Chris Scharver wrote:

Hi Chris,

 I've made some modifications to your code below. It should work ...

 Note that if you have interleaved data then things get a tidbit more
complicated ...

A+,

Alexandre.

> Hi.
>
> What's the correct process to extract data from a pfGeoSet? I cannot seem
> to get the vertex data for the PFGS_COORD3 attribute. I check the number
> of primitives, I get the attribute rangem and then I call getAttrLists;
>
> int numgsets = gd->getNumGSets();
> pfGeoSet *gs = ((pfGeode*) obj)->getGSet( 0 );
> int bind = gs->getAttrBind( PFGS_COORD3 );
> int rMax;
> int nverts = gs->getAttrRange( PFGS_COORD3, NULL, &rMax );
> void *verts;
> ushort *vindex;
> gs->getAttrLists( PFGS_COORD3, &verts, &vindex );
  float *v = (float *)verts;
> for (int i=0; i<gs->getNumPrims(); i++)
> {
> cout << "Length of prim "<<i<<": "<<gs->getPrimLength( i )<<endl;
> for (int j=0; j<gs->getPrimLength( i ); j++, v+=3)
> {
> cout << "("
> << v[0] << " "
> << v[1] << " "
> << v[2] << ") ";
> }
> cout << endl;
> }
>
> Right now I'm just trying to print out the vertices as I parse through the
> geoset. However, I'm getting all 0's. Do I need to allocate memory for
> the pointer before I call getAttrLists, or does Performer directly pass
> the base pointer from within the geoset? The man pages aren't too clear
> a,d I couldn't find anything useful in the Insight books.
>
> Thanks,
> Chris
> __________________________________________________________________________
> Chris Scharver EECS Graduate Student
> Electronic Visualization Laboratory EVL Phone: 312-996-3002
> The University of Illinois at Chicago EVL FAX: 312-413-7585
> 1998-1999 UIC Men's Swimming and Diving
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/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 2b29 : Wed Feb 28 2001 - 09:34:15 PST

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