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

Re: Rendering triangle meshes with OpenGL



On Thu, Sep 19, 2002 at 07:04:35PM -0300, Miguel A. Osorio wrote:
> Jorrit Tyberghein wrote:
> > 
> > Miguel A. Osorio wrote:
> > 
> > >       Thing is, I'd like to know if this way of doing it is ok in terms of
> > >performance, if this could be the cause of my slowdown. I know there are
> > >more efficient ways of doing this, like for instance, pre-processing the
> > >geometric data and converting everything to triangle strips, but is the
> > >presented way a bit too slow?
> > >
> > I think you should have a look at glDrawElements() instead. This is a
> > lot faster
> > compared to using display lists.
> > 
> 
> 	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().

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?

Al

PGP signature