Hi there, I'm trying to texture a quad in OpenGL, but I can't seem to do it properly. When I apply the texture, it doesn't scale the texture to the size of the quad, and instead, textures the quad with scales of the image.
Is there anything in particular I need to be doing in order to stretch a texture to fit the size of a quad?
OpenGL uses what are called Texture Coordinates, or locations located within a vertex that specifies a point on the texture.
So, if you have a square texture file, and a vertex with a Texture Coordinate of (0,0), then the texture image at that point will draw where the vertex is located in world space.
But OpenGL wants to do things in order, so to bind a texture you must specify the texture you are going to bind and the vertexes that you are going to bind it to. This is different then DirectX where you specify what Microsoft calls a Flexible Vertex Format, and within that struct you define the texture coordinate.
What you are doing right now is repeating the texture. This is a flag in OpenGL that can be set.
Thanks, that link is incredibly helpful, and I've now managed to stop the texture repeating.
However, the texture is still incredibly small in scale, and I can't seem to find anything on that site that explains this.
Would you happen to know any way to scale the size of the texture image?
Woops, my bad, just didn't read through it properly. Thanks a bunch!