Results 1 to 2 of 2

Thread: texturing a md2 model

  1. #1

    texturing a md2 model

    Hi,

    I have an md2 rendered correctly in wireframes. But now i need to texture it. Here's what i got:

    Given:
    verts and st are valid pointers and contain correct data. Also you should know that this code gets called in a loop once for each primitive in the model. Me thinks the problem is my st array is twice as big as the indice array. This should be hopefully just opengl syntax that i'm doing wrong. Or need to do.

    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glVertexPointer(3, GL_FLOAT, 0, verts);
    glTexCoordPointer(2, GL_FLOAT, 0, st);

    if(model->Primitives[i].PrimitiveType == MD2_TRIANGLESTRIP)
    {
    glDrawElements(GL_TRIANGLE_STRIP, model->Primitives[i].NumFaceIndices,
    GL_UNSIGNED_INT, indices);

    }

    if(model->Primitives[i].PrimitiveType == MD2_TRIANGLEFAN)
    {
    glDrawElements(GL_TRIANGLE_FAN, model->Primitives[i].NumFaceIndices,
    GL_UNSIGNED_INT, indices);

    }

    Thank you.

  2. #2

    Re: texturing a md2 model

    hmmmm

Similar Threads

  1. texturing a car model
    By nick2price in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-05-2008, 01:04 PM
  2. Replies: 1
    Last Post: 06-02-2006, 11:52 AM
  3. how to do model clothing & multi-model texturing.
    By Deepak Roy Chittajallu in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 11-19-2004, 07:26 PM
  4. OBJ Model Texturing Problem
    By 31337 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-06-2002, 11:18 AM
  5. GLUT texturing solid model...
    By Cybernet_X in forum OpenGL: Linux
    Replies: 3
    Last Post: 07-16-2002, 08:30 AM

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