From: Stace Peterson (stacep++at++sgi.com)
Date: 10/10/2004 17:39:05
Raymond,
Like many other loaders, the iv loader uses the pfdGeoBuilder to
optimize the input geometry for rendering. Unfortunately, this causes
individual triangles to be converted into triangle strips. There is no
easy way to tell the loader not to do this conversion. It would be
possible to add a new mode to the inventor loader to skip this
optimization by adding code to pfiv.C (the source for the loader is
included with Performer). See the man pages for pfdConverterMode for
more on modes (and the code for pfdConverterMode_iv in pfiv.C). This
may be the preferred solution because you may be able to ensure that no
conversions happen to your data, which sounds like a desirable
condition. Unfortunately, it also may require a fair amount of hacking
around in the loader.
Other solutions which may require less coding are to convert the
stripped geometry back into separate triangles by using the
pfdExtractGraphTriangles call, which converts a scene graph into a
single unstripped geoSet. This may need a little bit of work to bring
over geo state information if that's needed as well.
Additionally, if you are willing to wait for Performer 3.2, there will
be additional pfd functions which can perform quite a few different
conversions, most of which are intended for rendering optimization, but
can be used for any other purposes, such as converting stripped geometry
to unstripped geometry, or converting indexed pfGeoSets to unindexed
pfGeoArrays. Once Performer 3.2 is released, see the man pages for
pfdOptimizeGraph for more on these functions.
These last two will not insure that the triangles in the geometry are
exactly the same as the input - that is, the indices may be changed, and
the order of the triangles could be different. In fact, I would be
quite surprised if they are the same after two conversions.
I hope this helps.
Stace
------------------------------------------------------------------
Stace Peterson stacep++at++sgi.com
Silicon Graphics, Inc. (650) 933-2323
Pei Chen wrote:
>
> Hey, Zorana and Paolo,
> I had read through the pfdGeoBuilder and all documentation too, just
> couldn't find out what Performer has done to the .iv mesh data. Dose
> anybody has the answer to this problem? Thanks in advance!
>
> Raymond
>
> On Wed, 6 Oct 2004, Zorana Mayooran wrote:
>
> > Hi Paolo,
> >
> > I am using the pfflt loader and have the same problem as Raymond in that
> > I need to work with PFGS_TRIS but can't because performer loads my model
> > as PFGS_TRISTRIPS. I had a look through all the documentation available
> > (including the pfflt loader and pfdGeoBuilder) but couldn't find how I
> > can tell performer to load my model as PFGS_TRIS and not PFGS_TRISTRIPS.
> > Do you have any ideas on how this can be done?
> >
> > Thanks.
> >
> > Regards,
> > Zorana.
> >
> >
> > Paolo Farinelli wrote:
> >
> > > Hello Raymond,
> > >
> > > the source code for the .iv loader is shipped with Performer and
> > > can be found in /usr/share/Performer/src/lib/libpfdb/libpfiv.
> > > (or %PFROOT%\Src\lib\libpfdb\libpfiv on Win32).
> > >
> > > You may also need to look into the source for libpfdu as I believe
> > > the iv loader uses the pfdGeoBuilder API to create its geometry.
> > >
> > > Hope this helps.
> > > Regards,
> > > Paolo
> > >
> > >
> > > Pei Chen wrote:
> > >
> > >> Hey, everybody,
> > >> I have some questions regarding to pfGeoSet and loading a *.iv file
> > >> into a
> > >> pfGeoSet here.
> > >>
> > >> I have an Inventor file (*.iv) which specifies an indexed triangle
> > >> mesh. I
> > >> use pfdLoadFile() to load the mesh data into the performer. later in my
> > >> project, I need to access individual vertex using the corresponding
> > >> index.
> > >> It seems that, however, Performer dose some optimization to the mesh
> > >> data
> > >> such and the indics of the mesh vertics are different than those
> > >> specified
> > >> in the .iv file.
> > >> For example, in the .iv file, it says a triangle face is formed by
> > >> vertics
> > >> 0,1,2, but after I load it into the pfGeoSet object, the Performer says
> > >> the
> > >> same triangle face is formed by vetics 4, 5, 6.
> > >>
> > >> There is another problem with the pfGeoSet. It seems Performer also
> > >> changes
> > >> the number of vertics when it loads in the mesh data from .iv file. For
> > >> instance, in the .iv file, 8 vertics are specified. But when i load it
> > >> into
> > >> the pfGeoSet, it splits some vertics and the number of vertics
> > >> changes to
> > >> 18.
> > >>
> > >> The last problem is the primitive type. I really want the Performer
> > >> treat
> > >> my
> > >> mesh data as PFGS_TRIS type, that is triangle mesh, but when i use
> > >> pfdLoadFile() to load in the mesh data, Performer always treats my mesh
> > >> data
> > >> as PFGS_FLAT_TRISTRIPS, that is flat triangle strip mesh. Is there
> > >> any way
> > >> to tell Performer that I want PFGS_TRIS intead of PFGS_FLAT_TRISTRIPS.
> > >> I tried the pfGeoSet->setPrimType(), but it dosen't work.
> > >>
> > >> So, what I want to know is what exactly happen when I load in a .iv mesh
> > >> data using pfdLoadFile().
> > >>
> > >> Thanks.
> > >>
> > >> Raymond
> > >>
> > >> -----------------------------------------------------------------------
> > >> List Archives, Info, FAQ: 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
> > >> -----------------------------------------------------------------------
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> >
> >
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: 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
> -----------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Sun Oct 10 2004 - 17:39:16 PDT