[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rendering triangle meshes with OpenGL



Al Riddoch wrote:
> 
> >
> >       Ok, I took a look at the glDrawElements() and the whole system behind
> > it (setting up the arrays with glVertexPointer and the like, etc.) Thing
> > is, if I got it right, glDrawElements uses an array of indeces to the
> > other arrays (vertex, normal, texture coords) to draw primitives. But
> > one thing with the ASE files is that there are more texture coordinates
> > than vertices - in fact, I believe there are as many texture coords as
> > faces, and not as vertices. So how can I use the texture coordinates
> > array if it's bigger than the vertex and the normal array?
> >
> 
> There is another call you can use which does not use an array of index,
> I think its glDrawArrays().


	Sure, but I believe that in the case of data read from an ASE file,
using glDrawElements is a more direct approach. glDrawArrays should do
fine if your vertex data, for instance, is already ordered nicely to
represent the triangles, which is not necessarily the case with this
file format.


> 
> There should be the same number of texture coordinates as there are
> vertices, but I am not sure what to do if there are more. Do the specs
> for the file format give any clue as to why that might be the case?
> 

	I'm taking a look at this closely, but for now I'm sure there are more
texture coordinates than vertices, unless there is some redundancy that
I haven't noticed, but I believe that's not the case.




Miguel A. Osorio.