开发者

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?

开发者 https://www.devze.com 2023-04-10 10:50 出处:网络
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 textu

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

精彩评论

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