OpenGL 玻璃 HUD?
你好,我想知道如何制作看起来像“玻璃”的东西,例如皮克敏游戏中的例子。
它在 HUD 中,我想知道如何创建类似的东西。 我并不是想复制游戏,我只是喜欢它的外观。
它看起来像这样: http://3. bp.blogspot.com/_CWor6UdXxBk/SbaZDWSF6VI/AAAAAAAAFCU/UQgBvgGq-VE/s400/pikmin.jpg
其中有数字的矩形
我知道如何创建 HUD 但是我想知道如何动态生成背景矩形如示例中所示
Hello I Would like to know how to make somthing that looks like "Glass" the example would be in the game called Pikmin.
its in the HUD and i would like to know how to create somthing similar.
I Am not trying to copy the game i just like how it looks.
It looks like this: http://3.bp.blogspot.com/_CWor6UdXxBk/SbaZDWSF6VI/AAAAAAAAFCU/UQgBvgGq-VE/s400/pikmin.jpg
The rectangles that have numbers in them
I Know how to create an HUD However i would like to know how to dynamicly genorate the background rectangles like in the example
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该研究 alpha 混合来绘制气泡。假设它们的反射是静态的,您所需要的只是一个简单的图像。 (如果您不确定图像应该是什么样子,请看一下游戏中的黑墙。您看到的白色部分应该是图像的红色、绿色、蓝色和 Alpha 通道的样子。)
数字是只是绘制在气泡顶部(或下方)的另一组 alpha 混合图像。上述内容也适用于他们。
You should look into alpha blending for drawing the bubbles. Assuming the reflections on them are static, all you need is a simple image. (If you aren't sure what the image should be like, look at a black wall in the game. The white parts you see should be what the red, green, blue AND alpha channels of the image look like.)
The numbers are just another set of alpha-blended images drawn on top (or below) the bubbles. The above goes for them too.
看起来它们只是带有 Alpha 混合的纹理。一个矩形,一个圆形,然后绘制并缩放为适合其中任何内容的多边形。
It looks like they're just textures with alpha blending. One rectangular, one circular and then drawn and scaled to a polygon that fits whatever goes in them.