Re: setting texture coordinates

New Message Reply Date view Thread view Subject view Author view

AnitaKishore (kishore++at++electrogig.com)
Tue, 27 Feb 1996 13:43:51 -0800


> > 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?
>
> This should work. Are you sure you haven't ended up with separate copies of
> the texture coordinate arrays or the geoset in the two processes? You may
> be updating the APP copy of the geoset, and the DRAW copy isn't being
> updated...
>
> Can you supply a little more info?
>
> -Tom
>

I'ld be glad to...

        If I update texture coordinates from the DRAW process, it takes
effect. The updation is as follows:

DRAW callback:

        pfVec2 *texcoord = NULL;
        ushort *ilist = NULL;

        pfClearChan(chan);
        pfDraw();

        // Now update tex coord.
        pfGetGSetAttrLists(*gset, PFGS_TEXCOORD2, (void **) &texcoord, &ilist);

        for (int i=0; i<4; i++)
            texcoord[i][0] += 0.1f; // translate along horizontal axis only

        pfGSetAttr(*gset, PFGS_TEXCOORD2, PFGS_PER_VERTEX, texcoord, ilist);

The above works fine if called from DRAW. But if I call the tex coord updation
part from the APP, then no change takes palce in the tex coordinates, ie: no
translation takes place.
"*gset" has been malloced in the pf shared arena and is a global var.

Hope this makes more sense.

thanks
-anita

--------------------------------------------------------------------------
Anita Kishore
kishore++at++electrogig.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:52:27 PDT

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