   Transformation vs Rendering stage
  Hi all!Whew, this is hard to word properly without many run-on sentences...I''ve got a space shooter project in the works, usingOpenGL, and I''ve been reading a Direct3d book.In this book, it says to do the transformations forall geometry, and then after all vertices are transformed,render them.  Now, in D3D you can change the primitivetype that is being drawn in the between the Begin()/End() pair, but OpenGL does not allow this.  I''ve read many times that you should use as few glBegin()/glEnd() pairs as possible, with 1 pair being optimal...Would this not chew up a Metric Buttload(tm) of ram, sinceif you Transform and Draw concurrently, you can keep an indexedarray of model geometries and only need to store each model''s geometry once? You could simply apply the transformation matrices, and then draw the indexed model.Yet...If you transform all of the objects on the screenand store their respective geometries for use later in the render phase, you now need to alloc enough ram for each object''s geometry, even if many of those objects use the same model geometry.Also, while you could render only triangles, you cannot at the same time, in one glBegin()/glEnd() pair, draw triangle_strips.  This would force you to pass more geometrythan is necessary in many cases, thus causing a bottleneck in the rendering pipeline...Does anybody know how to do this efficiently? -Corey  
  Hey.First off, if this is not what you''re asking at all, it''s because I don''t understand completely lol.  But if I get what you''re saying...Don''t store the transformed vertices of every object.  Rather keep the static model of the object, then as you render them either (the preferred option) set the gl modelview matrix to transform them appropriately or (the book way) right before you render a model, transform the verts, and then render, then on the next render of that model just overwrite the old transforms with the new and pass them in again.Walt  ;  OpenGL (or DirectX) transforms the veritces. You don''t get the tranformed vertices back. Unless you use the Direct3D ProcessVertices() call, which is a horribly broken API, because it doesn''t allow you to use the tranform function of the graphics card; it has to do it on the CPU.Just issue your geometry to the graphics library; it''ll figure out when and how to transform and rasterize the graphics. Once SwapBuffers() has returned, you know that all that you issued is on its way to the user, so you can go on to render the next frame.  ;  How did you come to the conclusion that DX can change primitive type between Begin and End? dx has nothing like glBegin and glEnd, maybe you confuse it with BeginScene and EndScene which are an encapsulation of the whole scene ( opengl has nothing similar since its always in ''scene mode'') And glBegin/glEnd shouldn''t be used in an application that needs speed, take a look at vertexarrays, and later take a look at ARB_VERTEX_BUFFER_OBJECT ( its amost the same as vertexarrays, but you can allocate a buffer in faster memory, like agp or videoram);  From a performance point of view the transforming stage(matrix*vertex ops) costs no more than 5-20% of the total rendering time so I think that it''s not a bottleneck...However you can use vertex array or similar and reduce it. Store transformed vertices (if you think) is not a solution:you waste a lot of memory for what? If your view changes you have to recompute every vertices again (and store them!!!)Be sure: OpenGL rules!!!  ;  Thanks for all your replies!Heh..  For some reason, I forgot that display lists/vertex arrays are not called between glBegin()/glEnd()...Is a vertex array faster than a display list when fewpolygons are being drawn?I tried to render a skybox in a previous project, usinga display list, and it halved my framerate when compared tousing glVertex3f()''s to draw the cube. Okay, guess it''s time to get rid of all the glBegin/glEnd pairs and see what happens... Thanks again! -CoreyP.S.  Mazynoc, you''re exactly right. Skimming through the d3d book ("Beginning Direct3d Game Programming"), I thought that BeginScene and EndScene were equivalent to GL''s glBegin and glEnd.;  http://www.opengl.org/developers/faqs/technical/displaylist.htmThe above link should answer most of your questions 