Advertisement

Texturing Polygons that have more than 4 vertexes

Started by May 27, 2000 08:42 PM
1 comment, last by Jean-Philip Desjardins 24 years, 5 months ago
Is there a way to texture an polygon that has more than 4 vertexes using glTexCoord2f()?
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
Advertisement
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