@jmonillo said: I fail to see it, I'm sorry. How would that be with, for instance, a pentagon?
Check how I assign the texture in this video from about 20min on, that should make it clearer. Best watch the whole video.
@jmonillo said: I fail to see it, I'm sorry. How would that be with, for instance, a pentagon?
Check how I assign the texture in this video from about 20min on, that should make it clearer. Best watch the whole video.
@jmonillo said: I fail to see it, I'm sorry. How would that be with, for instance, a pentagon?
That would depend on how you wanted the texture to appear on the pentagon.
Forgive my crude drawing:
The one on the left is showing you what âtexture spaceâ is. No matter what size your texture is in pixels, OpenGL will treat it as a coordinate space from 0âŚ1 as zarch described.
The other two show possible ways to map texture coordinates to the pentagon. There are literally an infinite number of ways depending on the effect desired. For example, you could also give each triangle the exact same texture coordinates in which case each triangle in the pentagon would look like clones of each other.
If the information provided still isnât making it click then there are bound to be several good places to look online to understand âtexture mappingâ. This is pretty basic information and we tend to assume the user has some passing familiarity with these concepts already.
A google search for âtexture coordinatesâ seemed to yield better results than âtexture mappingâ. Here is the first link:
âŚat the bottom it includes a direct reference to the OpenGL red book. Thatâs probably useful reading even if the other answers start making it click.
Click!
Now I see it. I donât know why I wasnât seeing those coordinates referred to the texture. Many thanks.
Now I have the problem of calculating which texture coordinates should have a vertex on an arbitrary polygon. I donât know how, but Iâll work on it.
@normen : I havenât been able to look the video yet, because I have a bad internet connection. I expect seeing it soon. Thanks.
Inspiration came to me during the siesta, and yesterday in the evening I manage to write the code that calculates texture coordinates from 3D coordinates. I have tested in two shapes:
Thereâs still this strange effect on lightning when I add or remove the first piece (lightning of the room changes). So, something goes wrong.
But as the topic is âUniform texture on a surface made by trianglesâ I will call this âsolvedâ, while I work on the other problems.
Many thanks for all of you that brought me your help.