Re: setting texture coordinates
John Rohlf (jrohlf++at++tubes)
Wed, 28 Feb 96 9:34:20 PST
>
> On Feb 28, 4:59pm, Robert Webb wrote:
> > Subject: Re: setting texture coordinates
> > AnitaKishore <kishore++at++electrogig.com> wrote:
> >
> > > I am doing texture coordinate translation in the DRAW process by obtaining
> > > the current coordinates, updating them as needed and setting it back again
> > > on to its geoset. I want to know if there is a way to do this from the APP
> > > process too. I have tried following the same procedure in the APP process,
> > > but the new coordinates do not take effect. I thought it would be possible
> > > because initially all geometry is created and assigned texture coordinates
> > > from the APP process. So why can't I change it later on from within the
> same
> > > process?
> >
> > Ah, your array of texture coordinates must be allocated from the shared
> > arena with pfMalloc() before pfConfig(). After the processes are forked off
> > with pfConfig(), they then each have their own copy of all variables, so
> > arrays that are not in shared memory will be copied. So in your APP you are
> > not changing the same array as the DRAW is using. You must also be sure you
> > allocate the array before pfConfig() because if it is done after, only the
> > APPs local copy of the pointer to the array will be set top point at the
> > right place.
> >
> > Was this the problem?
> >
> > Rob.
> >
>
>
>
>
> Well, my simple question is:
>
> Is it possible to update texture coordinates of a particular
> geoset from the APP process? If so, then how?
>
You should use a pfCycleBuffer for the texture coordinate
array. /usr/share/Performer/src/pguide/libpf/C/morph.c uses a cyclebuffer
for a geoset's colors. One thing to remember is that you need to update
all texture coordinates in the array before calling pfCBufferChanged().
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:52:27 PDT