split the image into a mesh of small quadrangles in OpenGLES

后端 未结 1 1504
日久生厌
日久生厌 2020-12-31 22:30

How do I split the image into a mesh of small quadrangles in OpenGLES.

I need to split image in small parts and after that stretch only one part of the

相关标签:
1条回答
  • 2020-12-31 23:13

    Can you explain more detailed? What quadrangles would you like to use? Are they simple rectangles or squares? Or they are a bit more complicated like parallelogram, trapezoid, kite or rhombus?

    Anyway it's easy to split an image into any quadrangles you want. You can get any quadrangle from your image by telling OpenGL about image coordinates: glTexCoord2f(x, y)

    I forgot to mention that image in OpenGL is loaded with size (1.f, 1.f) and it doesn't matter what size your picture is you can split it in as many as you want quadrangles.

    There is one very useful tutorial about texture mapping maybe there you get your answers more detailed. Also i recommend you to keep an eye on official OpenGL documentation.

    Good luck.

    0 讨论(0)
提交回复
热议问题