Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Tri-Strips Texture Coordinate PROBLEM!!!

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    3

    Tri-Strips Texture Coordinate PROBLEM!!!

    Hi! That's my first time so...don't hurt me :P

    I'm working on a 3DS Max 4 Exporter plug-in and after coding ... well, debuging a way to build triangle strips, a PROBLEM came across: ¿How do I get Texture Coordinates correctly to match triangle strips?

    Little explanation (Taken from an exported cube with "Box - UVWMapping"):
    - Suppose that my resulting strip is: 4 5 7 1 3 0 2 ...
    - When you send those vertex indices to OpenGL with "glBegin(GL_TRIANGLE_STRIP)", it builds:

    face 4 5 7
    face 5 7 1
    face 7 1 3
    face 1 3 0
    face 3 0 2
    .... . . .

    - Suppose that texture indices to this faces are:

    face 4 5 7 - 14 15 16
    face 5 7 1 - 5 23 1
    face 7 1 3 - 22 20 21
    face 1 3 0 - 12 11 13
    face 3 0 2 - 10 8 9
    .... . . . - . . .

    - So, ie: vertex 7 has 3 different texture indices {16, 23, 22} while in my strip structure it's only called once...

    I hope to make me understood, with my 2 most powerful weapons: my poor kindergarten english and my privileged crashed apple like IQ

    I know that Quake2 model files have tri-strip info, but I don't understand the way it works to get texture coords. It saves again the UV coords? Any volunteers?

    And the question is: ¿ How can I assign those different texture coordinates to the same vertex (with OpenGL) ?
    Any brighter (happy face, happy face) idea...

    Thanks!
    "Aqui mi fusil. Aqui mi pistola..."

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    604

    Re: Tri-Strips Texture Coordinate PROBLEM!!!

    Unfortunately, there is no way to send more than 1 texture coordinate per texture unit per vertex when drawing triangle strips.

    You'll have to split up your strip whenever there are multiple texcoords on a single vertex.

    -- Zeno

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jan 2002
    Posts
    204

    Re: Tri-Strips Texture Coordinate PROBLEM!!!

    Usually when exporting from max if the verts are truly on the same poly then 16, 22, and 23 will have the same coords. Don’t forget 16, 22, and 23 are indexes into the true texture coords.

    John.

  4. #4
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    3

    Re: Tri-Strips Texture Coordinate PROBLEM!!!

    Ok, but in the model stripifier code of Quake 2 source I can't see any discriminating code to separate vertices with different texture coordinates although it works (with two floats U and V, followed by a vertex index), I've tried it.

    Can someone explain, how can quake 2 models apply strips with textures, to me?
    "Aqui mi fusil. Aqui mi pistola..."

  5. #5
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,074

    Re: Tri-Strips Texture Coordinate PROBLEM!!!

    AFAIK, quake 2 models only have 1 texture (skin) which is wrapped around the whole mesh, thus there are no multiple-texture-coordinates per vertex.
    - Michael Steinberg

  6. #6
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    3

    Re: Tri-Strips Texture Coordinate PROBLEM!!!

    Almost all of you were right
    You have to split the strips where vertices have different texture coord
    "Aqui mi fusil. Aqui mi pistola..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •