Scott Herod (herod++at++evt.com)
Tue, 07 Jul 1998 09:47:25 -0600
I wrote something to deform a mesh by getting all of the
vertices and normals in the object then moving each per frame.
My model was small, only about 1000 vertices, so my R5k O2 had
no trouble making frame rate. I did discover a couple of things
to be careful of. Do as much fixed body motion with a DCS as
possible, especially translations so that Performer will take
care of a moving bounding sphere. I recomputed normals at each
step but it would likely be more efficient to compute differential
of your transformation and adjust the normal vectors accordingly.
To get the vertices and normal vectors use the getAttrLists() method
of a GeoSet as for example:
geode->getGSet(j)->getAttrLists(PFGS_COORD3, (void**)&coords,
&icoords);
int numcoords = pfGetSize(coords) / sizeof(pfVec3);
for(int counter=0; counter<numcoords; counter++){
move coordinate
}
Look at the morph.C (or morph_engine.c) example for more details.
Speaking of which, depending on the motion that you are trying to
achieve, you might be able to use pfMorph (or pfEngine and pfFlux).
For large data sets I doubt the above would work well but I don't have
any experience with such.
Scott Herod
herod++at++evt.com
scott.herod++at++colorado.edu
Stefano Conconi wrote:
>
> Hi to all,
>
> Which could be the right way to simulate a deformation of a mesh?
>
> If we have a mesh with different polygons shape and the dynamics of all
> the vertices what can we do simulate the dynamics of all the vertices?
>
> Using performer can I traverse the vertex structure and change the
> position for each vertex?
>
> Or, have I to use the Multigen API, for example, to modify the db and
> every step to reload the dataset by performer's functions?
>
> There is some app. sample about this kind of applications?
>
> There is some function in performer that can permit me to get all the
> concurrent verteces of the adiacent polygons?
>
> Any suggestion will be appreciated?
>
> Thanks
>
> Stefano
=======================================================================
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:57:41 PDT