Rendering a .md2 via vertex array, texturing problem
make an indexed vertex array with the vertices and the respective texcoords.
in md2 numTexCoords != numVertices so u''ll have to get the texcoords for each vertex.
the md2face has 6 indices, 3 for vertices and 3 for texcoords so use those
remember that only the first frame has tex coords so u''ll make only one tex coord array.
hm are you sure you want to animate your models that way?
id further more interpolate between the current and the last/next frame
since vertex arrays store the geometry in your RAM you can easily apply the transformations
and probably you should use 1 big texture 1024*1024
that contains all your skin parts
once you got that you should be able to render your animated mode with one single call to glDrawArrays
thx for listening
id further more interpolate between the current and the last/next frame
since vertex arrays store the geometry in your RAM you can easily apply the transformations
and probably you should use 1 big texture 1024*1024
that contains all your skin parts
once you got that you should be able to render your animated mode with one single call to glDrawArrays
thx for listening
Sorry to bring back an old thread to life but I still have the same problem
Basiror : i implemented vertex interpolation now and it works real good
But I still cant get the mesh properly textured. I noticed that the md2 mesh had a index list for both the vertices and the texture coordinates.
Im thinking maybe this could be my problem, since when you call glDrawElement you only pass the triangle index list....
So somehow I would have to build my texture array so that every texture coord matches the correct vertice, I just dont know how to do it.
Basiror : i implemented vertex interpolation now and it works real good
But I still cant get the mesh properly textured. I noticed that the md2 mesh had a index list for both the vertices and the texture coordinates.
Im thinking maybe this could be my problem, since when you call glDrawElement you only pass the triangle index list....
So somehow I would have to build my texture array so that every texture coord matches the correct vertice, I just dont know how to do it.
well of course you need to build a texture coordinate array with one UV coordinate per vertex
otherwise it can t work
otherwise it can t work
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement