You're not setting texture coordinates for the last 2 vertices (5 and 6) on the second quad.
A:
Kevin
2009-05-15 14:11:53
A:
But how i do that, because i runned out coords for the first 4 vertices?
nunolourenco
2009-05-15 14:48:08
+2
A:
When you see this line of code:
glTexCoord2f(0.0,1.0); glVertex3f(-1.0f * size, -1.0f* size, 0); //1
the first statement, glTexCoord2f() specifies which point of the texture to hook up to the specified vertex (glVertex3f()). For each vertex you have to tell which point of the texture to map to it.
It might be usefull for you to look here: GameDev.NET - OpenGL texture mapping: An introduction Especially the part of "The texture coordinate system".
Hope this helps!
*edit, try http://nehe.gamedev.net/ as well! alot of OpenGL tutorials/articles, tutorial Lesson 6 has texture mapping in it. :) (Although it's not a very good example of good coding practice)
Kevin
2009-05-15 18:25:28
Thanks for your help ;)
nunolourenco
2009-05-15 19:40:13
That's what SO's for! Have fun! And if you get something neat going I'd love to see it. :)
Kevin
2009-05-15 19:51:34
Sure, I am doing a project to a course of this semester. When is finished I will be happy to show you :)
nunolourenco
2009-05-15 20:05:36
Nice, you can find my contact details through my site. (lower right is a "contact" link). Good luck with the project and your course!
Kevin
2009-05-15 20:28:00