   vertex arrays
  How exactly does one go about using vertex arrays?  I kinda sorta just realized my current project has 150 polys that are hard coded (oops).  Also, i was messing around w/ a loop the other day and it didn''t seem to work.  Does looping have the same syntax as ''normal'' c++ or is there some kind of glwhile thing?  
  What?Vertex arrays got totally different syntax from immediate mode. They are not a loop with immediate calls inside.The simples call isglDrawArrays(/*don't remember parameters now>*/);Which will draw an entire array in a single call.The other isglDrawElements(GL_TRIANGLES, verticesToDraw, GL_UNSIGNED_INT, indices);Which will draw 'verticesToDraw' vertices from the current VERTEX array in the order specified by 'indices', possibly optimizing shared vertices.You can enable/disable vertex arrays using glEnableClientState/glDisableClientState (valid arguments are GL_COLOR_ARRAY, GL_NORMAL_ARRAY, GL_TEXTURE_COORD_ARRAY, GL_VERTEX_ARRAY and others - there's one texture array for each texture unit). You can set the active array using glVertexPointer (vertex array), glNormalPointer (normals) and so go on.Unluckly, the feature referred as 'vertex arrays' has a 'VERTEX_ARRAY' thing inside that... oh well, this is a unlucky part of the interface design...EDIT: HTML messed up something in the DrawArrays call... fixed.[edited by - Krohm on May 25, 2003 4:37:52 AM];  Sorry... guess i'm confused.  I thought that vertex arrays hold coordinates for polys, and then you can loop through the array to create polys.  If this is not what they are used for... then i guess i don't really need help on that for now, but does looping follow the normal 'while(x < 10)' syntax in opengl?[edited by - heat511 on May 25, 2003 11:02:04 PM];  1. Vertex Arrays are good if u have all vertices in a buffer and sould be faster than immediate mode.2. What is a 'normal loop'? while(...) is a loop, for(...) is a loop...while(x) will loop until x becomes false.for(x=0; x<10; x++) will set x to 0, and then loop until x is greater or equal to 10. It will also increment x in every loop.So when u want to loop through an array, u can usefor(x=0; x<max x++){    // Stuff} orx=0;while(x<max){    // Stuff    x++;}  (has the same effect)You also could writefor(int x=0; x<max; x+=3) orx=0;while(x<max){    // Stuff    x+=;} 3. 'normal syntax in opengl'?OpenGL is a graphics library. You can use it whit any programming language. while(x < 10) is c++ syntax.Hope that will help PM  Times change...Excuse my poor english![edited by - PM on May 26, 2003 2:13:00 AM];  I am even more confused by what you are asking.quote:Original post by heat511   does looping follow the normal 'while(x < 10)' syntax in opengl?  Of curse. Provided this is the syntax you would use.quote:Original post by heat511   I thought that vertex arrays hold coordinates for polys, and then you can loop through the array to create polys   Parsing an array to 'create'? Usually, functions are used to 'create' results and arrays to store the results.'To create' is different from 'To draw'.What is usually called 'vertex arrays functionality' is a faster way to **draw** but does not help you in **creating** the per-vertex information. Sure you can do thuru vertex arrays and do whatever you want with them, they are just standard arrays after all.Try to be more clear, I don't understand...EDIT: added last line and comment about what arrays are for.[edited by - Krohm on May 26, 2003 2:54:10 PM];  ok, sorry about being unclear there... this is what happens when a newbie opengl programmer reads other posts and then days later unclearly asks stuff.  I guess i was confused by glfloats because i am used to standard c++ ''normal'' floats, so i wrongly assumed there would be glwhile and other syntax changes, so you guys answered that for me.  When asking about vertex arrays, i was wondering how i could use these to draw (sorry not create) polys, assuming I read in the information from a text file.  How would i go about drawing polys based off the information in the vertex arrays?  (I don''t really need help w/ any textfile stuff, just implementation of the arrays).Thanks,Drew  