   Rendering bounding volumes
  What is the best way to render a bounding volume? Since bounding volumes are (in most cases) rendered in wireframe I have to change the polygon mode (to GL_LINES from GL_FILL), is it better to draw them after the object they are referred to, or after all the scene has been rendered? This-pseudo code should make it clear:1. First casefor(int i=0; i<tot_objs; i++){   SetPositionAndRotation(objects);   Render(objects.Mesh);   glPolygonMode(GL_FRONT_AND_BACK,GL_LINES);   Render(objects.Bounding);   glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);}2. Second casefor(int i=0; i<tot_objs; i++){   SetPositionAndRotation(objects);   Render(objects.Mesh);}glPolygonMode(GL_FRONT_AND_BACK,GL_LINES);for(int i=0; i<tot_objs; i++){   SetPositionAndRotation(objects);   Render(objects.Bounding);}In the first case I could avoid to set two times rotation and translation, but I need to switch polygon mode 2 times for each cycle (from FILL to LINES and back)... in the second one I could avoid overdraw (since bounding volumes will be rendered only when the scene is completely rendered) and I should switch only one time the polygon mode... so, which one is better? Are there any other solutions? Is it too costy to switch polygon mode too often?
  generally you render bounding volumes only for testing purposes so i don't think you should worry too much about performance..anyway, i would use the second method, i think this gives you a more clear code :)potevo scrivertelo anche in italiano visto che sei di roma xò! cmq penso si abbastanza chiaro :)   ;  Ahahahaha! :DSi, è chiarissimo anche in inglese! :PTRANSLATION: Yes, it's clear in english too! :PFa piacere trovare ogni tanto qualche italiano da queste parti! ^^   