OpenGL ES 2 C ++,绘制两个对象 [英] OpenGL ES 2 C++, Draw two Object
本文介绍了OpenGL ES 2 C ++,绘制两个对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
另一个问题:^^
如何在OpenGL ES 2中绘制两个对象?
例如,我需要绘制三角形和矩形,其中实心三角形与透明矩形重叠.
在此先感谢
Hi,
Another question : ^^
How do I draw two object in OpenGL ES 2?
For example, I need to draw Triangle and Rectangle in which solid Triangle is overlapped by transparent Rectangle.
Thanks in advance
推荐答案
不确定是不是这个意思,但是,参考之前关于彩虹三角的文章,基本上是这样:
Not sure if you mean this, but, referring to your previous post about the rainbow triangle, you basically do this:
glVertexAttribPointer(attPosition, 3, GL_FLOAT, GL_FALSE, 0, vVertices);
glVertexAttribPointer(attColor, 4, GL_FLOAT, GL_FALSE, 0, warna);
带有一组不同的顶点和颜色.
with a different set of vertices and colors.
下一次我将发布解决方案
Next time I''ll post the solution
这篇关于OpenGL ES 2 C ++,绘制两个对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文