![]() I use Quartz 2D rendering methods to load the textures, but you can use whatever you want. Loading the texture should be an easy task, and I won’t mention it here. Note that the image should be square, to comply with OpenGL versions prior to 2.0 TextureID will hold the image texture ID. The last 2 variables are arrays that will hold the vertex and texture coordinates data correspondingly. As you can see, more divisions have more memory usage, and tend to behave slower. In the above image vertical divisions are 4, and the vertical ones are 8. The first two variables will hold the image grid’s size in divisions. The following image represents the grid as it will be created without the image being applied onto it.įirst of all, lets create the necessary variables that will hold our image grid. I will try to stay away from platform-specific instructions as much as possible. The code I will give you will work on PCs, Macs, and Mobile Devices that run on top of OpenGL. Note that I will try to comply with the general rules as much as possible. ![]() I will not show you the way of performing the wave effects, but I will try to point you in the right direction of creating the grid behind the image. ![]() ![]() Images created using grids allow you to do various effects on images, like the famous wave effect, or a ripple effect. There are sometimes that you may need to create a gridded image. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |