本文介绍了OpenGL在纹理上绘制纹理(?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我目前正在尝试开发2D游戏,但我遇到了一个小问题。我想听听经验丰富的游戏开发者的一些答案。



所以让我说我有一个墙纹理。玩家在其上射击子弹,然后如何在墙壁纹理上绘制子弹纹理?后来如果我想使用相同的纹理,我如何在另一个墙上的物体上使用完全相同的墙面纹理(没有子弹)?



游戏开发者通常如何这样做?

Hi,

I am currently trying to develop a 2D game, but I came through a little problem. I would like to hear some answers from the experienced game developers.

So let''s say I have a wall texture. A player shoots a bullet on it, then how do I draw the bullet texture on that wall texture? Later if I want to use the same texture, how do I use that exact same wall texture (without the bullet) on another wall object?

How do game developers usually do this?

推荐答案

引用:

玩家在其上射击子弹,然后如何在该墙纹理上绘制子弹纹理?

A player shoots a bullet on it, then how do I draw the bullet texture on that wall texture?





我的建议是用背景场景(墙)和子弹重绘场景。您可以保留墙面纹理而无需任何更改。在背景墙(墙)上绘制物体(子弹)。



DrawScene()

1.绘制墙面纹理。

2.绘制项目符号(此图纸将为在墙上)。



My suggestion is to redraw the scene with the background scene(wall) and bullet. You can retain the wall texture without any change. Draw objects(bullets) on top of backbground(wall).

DrawScene()
1. Draw Wall Texture.
2. Draw Bullets( this drawing will be on top of wall ).


这篇关于OpenGL在纹理上绘制纹理(?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 13:19