Texturing Polygons that have more than 4 vertexes
Is there a way to texture an polygon that has more than 4 vertexes using glTexCoord2f()?
Yep!
Edited by - baskuenen on May 27, 2000 10:05:22 PM
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
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
Popular Topics
Advertisement