Texture on torus



Hi,

can anyone help me with stretching texture on torus? :)

my code is as follows:

for texture generation:
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);

now my torus is covered with many copies of texture, then I'm doing that:

glMatrixMode(GL_TEXTURE);
glScalef(0.4,0.4,1);
glMatrixMode(GL_MODELVIEW);

the size is now ok, but the problem is that my texture is placed independently on both sides and adjoins on the edges, and I wanted to have whole torus covered with one square texture (suitable stretched and deformed).

Is it possible?

wojtek

.



Relevant Pages

  • Re: Rendering Texture on Mesh.XXXX
    ... If indeed your torus has no texture ... then I think that you will need to create a new vertex buffer ... > I'm evaluating Managed DirectX and have a simple task. ... > I want to apply the banana.bmp to a torus created with Mesh.Torus. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Texture on torus
    ... can anyone help me with stretching texture on torus? ... Texture coordinate generation ... Consider the torus being a cylinder, that hes been bent into a ...
    (comp.graphics.api.opengl)