Advertisement

Vertex Arrays

Started by May 06, 2000 04:49 PM
2 comments, last by WickedMystic 24 years, 6 months ago
Heya, I have a question about vertex arrays. Say I have a vertex-array containing 1000 vertices and another array which contains indices to the vertices. I know I can draw them using glDrawElements. Now I don't want to use OpenGL's 2D culling but I'd rather use my own culling routine which uses face-normals to determine if a face is visible. This way I dont have to transform vertices which aren't visible in the first place. My question is this: does OpenGL transform all the vertices in the vertex array or only the ones that are actually given in the array with the indices? Because that way I only have to 'rebuild' my array with indices and not the array which contains the vertices. If I have to rebuild both arrays(I dont really want to do that each frame), I also have to map the new indices onto the original ones etc etc. And this way I dont think it will be faster than just transforming all vertices and just do simple 2D face culling. WickedMystic Edited by - WickedMystic on 5/6/00 4:50:15 PM Edited by - WickedMystic on 5/6/00 4:51:33 PM
Use glDrawElements() and you only have to rebuild the indices array.

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
Advertisement
Thanks to your posts I was courius to know what glDrawElements() do and how so I searched for it in my Visual C++ help but I really didn''t manage to understand how to use it. I only realised that it is involved with the use of glIndexPointer(), glNormalPointer(), glTexCoordPointer and glVertexPointer is it right ?

Could you possibly please explain me how to use it (may with a code example) ?

If you want to mail me, do it at tripuno@tiscalinet.it or just post your message here so your stuff could be freely readable to all people.

Thanks



Magallo,

check these sites:

http://heron.cc.ukans.edu/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/@Generic__BookTocView/7109;cd=7;td=6

and

http://www.itknowledge.com/reference/archive/1571690735/ewtoc.html


WickedMystic

This topic is closed to new replies.

Advertisement