This is true if you are using the fixed-function pipepline. One thing that you may see in some web pages is that the first thing we must do is enable the textures in our OpenGL context by calling glEnable(GL_TEXTURE_2D). So the associated coordinates array will be like this: float positions = new float Īnd define the version of the library to use. In order to draw a cube we just need to define eight vertices. With the code base we have created, in order to draw a cube we just need to correctly define the coordinates of a cube and it should be drawn correctly. ![]() In order to show all the concepts related to textures we will transform the quad that we have been using in previous chapters into a 3D cube. In this chapter we will learn how to load textures and use them in the rendering process.
0 Comments
Leave a Reply. |