OpenGL??建????????????
???????????? ???????[ 2014/1/22 11:15:47 ] ????????OpenGL ??? ????
????????????????????????
????????????????????????3??????????????
??????????建????
void init()
{
glClearColor(0??0??1.0??0);
glClearStencil(0);
glClearDepth(1.0f);
glEnable(GL_STENCIL_TEST);
}
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);//1
glLoadIdentity();
glTranslatef(0?? 0?? -20);
glStencilFunc(GL_NEVER??0x0??0xFF); //2
glStencilOp(GL_INCR??GL_INCR??GL_INCR);//3
glColor3f(1.0f??1.0f??1.0f);
dRadius = 5.0*(sqrt(2.0)/2.0);
glBegin(GL_LINE_STRIP);
for (dAngel=0;dAngel<380.0;dAngel+=0.1)
{
glVertex2d(dRadius*cos(dAngel)??dRadius*sin(dAngel));
dRadius*=1.003;
}
glEnd();
glStencilFunc(GL_NOTEQUAL??0x1??0xFF); //4
glStencilOp(GL_KEEP??GL_KEEP??KEEP); //5
glColor3f(1.0f??0.0f??0.0f);
glRectf(-5??-5??5??5);
????????е?1????3???????????????
?????????????????????????????????
????????????????????????????1.0
??????建??????????????????????0
??????е?2??3??????????????????????????????????????????????+1
???????????????????л???????????????????????????????????????????????????仯????????????????????????????1?????
?????????????????????????????????
????????????????????????????1.0
??????建??????????????????????1????????????????????????0
??????е?4??5?????????????????????????1??????????????????????????????+1
??????????????????????л??????(-5??-5??5??5)????Σ??????????????????????????????2?У???1??????1????????顣??0??????????????????????????????????????????????0???????????????????????滻???????????????滻?????????????0?????????????????????????????????????
???????????????(-5??-5??5??5)?????? ?????0?????????????????????????
????????????????????????????1.0
??????建??????????????????????1????????????????????????0
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11