开发者

How to draw a image as a texture of a polygon and how to rotate the polygon in all directions touching the polygon on the screen?

I need to draw a texture on a square polygon, not a cube, i need to do it on a symple square, it is the face of a cube. I check this tutorial (open gl ES)and it seems to work fine for writting a texture on a square polygon: http://blog.jayway.com/2010/12/30/opengl-es-tutorial-for-android-%E2%80%93-part-vi-textures/

OK, but now i need to rotate the polygon with the finger, touching the screen. I need that the user can interact with the polygon touching it, movi开发者_JS百科ng the polygon in the direction that he moves the polygon with the finger.

How can i do it?


As you are using opengl es, there is a function called glrotate which is used to rotate the object. here is the link

http://www.khronos.org/opengles/sdk/1.1/docs/man/glRotate.xml

Just call this function according to the user touch interaction.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜