🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Texturing Polygons that have more than 4 vertexes

Started by
1 comment, last by Jean-Philip Desjardins 24 years, 1 month ago
Is there a way to texture an polygon that has more than 4 vertexes using glTexCoord2f()?
Advertisement
Yep!
glBegin(GL_POLYGON);glTexCoord2f(0.5F + 0.5F * cos(2*PI/5*0), 0.5F + 0.5F * sin(2*PI/5*0)); glVertex(...);glTexCoord2f(0.5F + 0.5F * cos(2*PI/5*1), 0.5F + 0.5F * sin(2*PI/5*1)); glVertex(...);glTexCoord2f(0.5F + 0.5F * cos(2*PI/5*2), 0.5F + 0.5F * sin(2*PI/5*2)); glVertex(...);glTexCoord2f(0.5F + 0.5F * cos(2*PI/5*3), 0.5F + 0.5F * sin(2*PI/5*3)); glVertex(...);glTexCoord2f(0.5F + 0.5F * cos(2*PI/5*4), 0.5F + 0.5F * sin(2*PI/5*4)); glVertex(...);glEnd();  




Edited by - baskuenen on May 27, 2000 10:05:22 PM
Yeesh!

I didn't get the math either

Take a look at this page on my website:

http://home.clara.net/paulyg/uv.htm

It shows one way of generating planar texture coords for arbitrary shaped surfaces.


Paul Groves
pauls opengl page
paul's opengl message board

Edited by - Pauly on May 29, 2000 8:11:55 PM
Paul Grovespauls opengl page

This topic is closed to new replies.

Advertisement