开发者

Semitransparent brush in GLPaint

How to create a brush that draw开发者_运维技巧s semitransparent lines in drawing view using OpenGL. My application is based on modified GLPaint.


The GLPaint sample already includes transparency. Go to the developer site and download the latest version of the code. You'll notice that it includes blending. Either that are you could draw all your points in your line path as GL_POINTS with a color that uses transparency, like so:

glDisable(GL_DEPTH_TEST);
glLineWidth(10);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);    
glColor4f(1, 0, 0, .5);
glDrawArrays(GL_LINE_STRIP, 0, vertexCount);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜