how?!
heh… i’ve searched for a while now looking for a way to use texture
mapping with a complex polygon tesselated by glutess, but the
only thing i found is this.
and the source and executable links are both 404, and the author
is MIA (since 2001 in fact). there are, however, screenshots showing
off what i need to accomplish, so i know it’s possible
actually, i was hoping to be able to tile my texture across a complex
polygon, but i’ll take this one step at a time.
anybody have any ideas, or even some tips to get started?
You can use glTexGen to automatically generate texture coordinates based on vertex positions. This will affect all geometry, including tesselated polygons. This example will setup the texture in the xy-plane:
var
v : array[0…3] of GlFloat;
…
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
v[0]:=1; v[1]:=0; v[2]:=0; v[3]:=0;
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, addr(v));
v[0]:=0; v[1]:=1; v[2]:=0; v[3]:=0;
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_T, GL_OBJECT_PLANE, addr(v));
It’s in Delphi, but should be understandable. addr(v) equals to v in c, I think.