[info-performer] Transparency problems

New Message Reply Date view Thread view Subject view Author view

From: Keith Parkins (kparkins++at++cs.rochester.edu)
Date: 01/16/2003 08:36:53


I am trying to create an airbush effect with the following code but have a
problem. When I run the code (which is executed in a channel postdraw) the
brush mark appears for a second before dissapearing. Any ideas?

void
drawScotoma(int split_x, int split_y)
{
   float radius = 50.0f;
   int i;
   int old_mode;

   old_mode = pfGetTransparency();
   pfTransparency(PFTR_ON);
   for (i = 0; i < 36; i ++) {
      float angle1, angle2;

      angle1 = 2 * M_PI * i / 36.0;
      angle2 = 2 * M_PI * (i+1) / 36.0;

      glBegin(GL_POLYGON);
      glColor4f(0.0, 0.0, 0.0, 0.0);
      glVertex2f(radius * cos(angle1) + split_x,
            radius * sin(angle1) + split_y);
      glVertex2f(radius * cos(angle2) + split_x,
            radius * sin(angle2) + split_y);
      glColor4f(0.0, 0.0, 0.0, 1.0);
      glVertex2f(split_x, split_y);
      glEnd();
   }
   pfTransparency(old_mode);
}

Keith Parkins U of R Computer Science
kparkins++at++cs.rochester.edu Computer Science Building, Room 606
(585) 275-1118


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Jan 17 2003 - 11:12:43 PST

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