PDA

View Full Version : How To Tile In A n-sided Polygon



Rohit Kothari
09-17-2008, 04:00 AM
Hi.
I m new to opengl and was making an application in which i require to texture a polygon(n-sided) with an image...So how ca n i do it...
i know that for a 4 sided polygon i can assign the tex coord as (0,0), (0,3), (3,3), (3,0) if i want to repeat it 9 times in the polygon....But how to do it if i want to do it for say any n sided polygon..

trinitrotoluene
09-17-2008, 07:15 AM
If your n-sided polygon lie on the xy plane before transformation, use x and y coord of the vertex for it's texture coord.