From: Keith Parkins (kparkins++at++cs.rochester.edu)
Date: 01/16/2003 08:59:05
FYI: here is where the code is called from:
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, x, 0, y);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
drawScotoma(split_x, split_y);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
On Thu, 16 Jan 2003, Keith Parkins wrote:
> 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
>
>
Keith Parkins U of R Computer Science
kparkins++at++cs.rochester.edu Computer Science Building, Room 606
(585) 275-1118
This archive was generated by hypermail 2b29 : Thu Jan 16 2003 - 09:00:23 PST