Results 1 to 2 of 2

Thread: Generating Textures ( a little buggy )

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2001
    Posts
    29

    Generating Textures ( a little buggy )

    What i'm trying to do is have OpenGL generate textcoords for my 3D Objects. I've enabled the texture autogeneration and it works but it's just that is only ONE image but OpenGL generates thousands of them, so i have to rescale the texture in order to get the right effect.
    I wonder if I cand have OGL generate the correct textures coords directly, without having to rescale the texture.

    I'm texturing ASC objects that are quite complex and concave. I do not want to use the texture coords imported from 3DSMAx, don't ask why.
    thanks for your help,
    Clau
    Claudius

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Generating Textures ( a little buggy )

    You can have OpenGL generate texcoords for you, but you will have limited control over them. You simply have to glEnable GL_TEXTURE_GEN_Q, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_S, G_TEXTURE_GEN_T. (Usually you won't enable all of them, just the ones you use for the TexGen method you use.)

    You can use glTexGen* to specify the function to use, and glTexGen*v to specify different coefficents on the functions used.

    An example..
    From MSDN...

    If the texture generation function is GL_OBJECT_LINEAR, the function

    g = p1x0 + p2y0 + p3z0 +p4w0

    is used, where g is the value computed for the coordinate named in coord; p1, p2, p3, and p4 are the four values supplied in params; and xo, yo, zo, and wo are the object coordinates of the vertex.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Handling textures when generating a shadow
    By Andreas Goebel in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-15-2006, 03:45 PM
  2. Generating and Loading textures
    By imported_zvivered in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 05-25-2003, 02:24 AM
  3. generating textures
    By werdy666 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-23-2002, 02:04 AM
  4. Generating Textures
    By DrakanFyr in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 11-14-2000, 11:34 AM
  5. Generating 2D textures from a 3D matrix (against the grain)
    By PeterK in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-30-2000, 05:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean