Chris Tanner (cct++at++faith)
Thu, 16 Jun 1994 13:21:08 -0700
I originally had the same problem when recently implementing callbacks to
attenuate light points
using texgen.
The answer is that texgen uses the model viewing matrix when texgen is actually
called verses
the model view matrix when the geometry is draw to figure out the transforms
necessary for
TG_CONTOUR. Thus, because you attach the callbacks to the leaf nodes in
performer, the
model view matrix is always the same when you call texgen as when you draw the
geometry.
Thus the effect is that of TG_LINEAR.
The workaround is quite simple, just load the model view matrix with the
identity matrix
before calling texgen then pop it afterwards.
SO...
example performer code:
long pfuPreDrawContour(pfTraverser *trav, void *data)
{
(trav, trav);
(data, data);
mmode(MVIEWING);
pushmatrix();
loadmatrix(IdentMat);
texgen(TX_S, TG_CONTOUR, params2);
texgen(TX_T, TG_CONTOUR, params3);
texgen(TX_S, TG_ON, NULL);
texgen(TX_T, TG_ON, NULL);
popmatrix();
return NULL;
}
long pfuPostDrawContour(pfTraverser *trav, void *data)
{
(trav, trav);
(data, data);
texgen(TX_S, TG_OFF, NULL);
texgen(TX_T, TG_OFF, NULL);
return NULL;
}
--_____________________________________________________________ Chris Tanner (cct++at++faith.asd.sgi.com) Silicon Graphics - Advanced Graphics Division _____________________________________________________________
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:20 PDT