I am trying to place texture on a circle but when I do, the texture appears on the circle four times instead of once. Is there something I am missing? I am using the bmp format for the image in the initscene
This is what I am doing in the render scene to set the texture on the wheel
texture coordinates begin at 0 and end with 1
if your coordinates go from -1 to 1 (as your code suggests), you either end up with a distorted texture or with a repetitive texture, depending on the texture parameters you’ve set
GL_REPEAT is likely what you’ve got, if a texture coordinate exceeds the [0;1] limits, the texture repeats itself
instead of
tex.x = cos(angle)
tex.y = sin(angle)
do this
tex.x = 0.5f * (1 + cos(angle))
tex.y = 0.5f * (1 + sin(angle))
[QUOTE=john_connor;1285114]texture coordinates begin at 0 and end with 1
if your coordinates go from -1 to 1 (as your code suggests), you either end up with a distorted texture or with a repetitive texture, depending on the texture parameters you’ve set
GL_REPEAT is likely what you’ve got, if a texture coordinate exceeds the [0;1] limits, the texture repeats itself
instead of
tex.x = cos(angle)
tex.y = sin(angle)
do this
tex.x = 0.5f * (1 + cos(angle))
tex.y = 0.5f * (1 + sin(angle))[/QUOTE]