开发者

How to texture cube with png image in OpenGL ES 2.0?

How do you t开发者_JAVA技巧exture a cube with png image in OpenGL ES 2.0? And how do you use atlas for the texturing?


For the good old cube demo, check this out.

The code is written in WebGL, but you can easily convert it.

However, if you have trouble converting it, then I suggest you start with the "Hello Triangle" demo first -- to get used to this.

There are two links.

  1. Tutorial on Hello Triangle
  2. Source Code for Hello Triangle -- Look at Chapter 2

To do the PNG part, you have a few options depending on your platform (Android, Palm, iPhone)

To give you at least one answer, if you are coding in C++, then you can use libPNG and that also requires zlib. There are many sites with the code to load a PNG into a Texture using C++. For instance.

Good luck!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜