Permalink
Browse files

removed redundant triangles from flag drawing

  • Loading branch information...
rtv committed Dec 3, 2011
1 parent afea962 commit e4631ee1b1bb50aad01f9ee7fff1f22e77dd6e94
Showing with 13 additions and 7 deletions.
  1. +13 −7 libstage/model_draw.cc
View
@@ -544,9 +544,6 @@ void Model::DrawFlagList( void )
glVertex3f( gp.x+0, gp.y+d, gp.z+0 +z);
glVertex3f( gp.x+0, gp.y+0, gp.z-d +z);
- glVertex3f( gp.x-d, gp.y+0, gp.z+0 +z);
- glVertex3f( gp.x+0, gp.y-d, gp.z+0 +z);
- glVertex3f( gp.x+0, gp.y+0, gp.z-d +z);
glVertex3f( gp.x-d, gp.y+0, gp.z+0 +z);
glVertex3f( gp.x+0, gp.y-d, gp.z+0 +z);
@@ -556,14 +553,23 @@ void Model::DrawFlagList( void )
glVertex3f( gp.x+0, gp.y+d, gp.z+0 +z);
glVertex3f( gp.x+0, gp.y+0, gp.z-d +z);
- glVertex3f( gp.x+d, gp.y+0, gp.z+0 +z);
- glVertex3f( gp.x+0, gp.y+d, gp.z+0 +z);
- glVertex3f( gp.x+0, gp.y+0, gp.z-d +z);
-
glVertex3f( gp.x+d, gp.y+0, gp.z+0 +z);
glVertex3f( gp.x+0, gp.y-d, gp.z+0 +z);
glVertex3f( gp.x+0, gp.y+0, gp.z-d +z);
+
+ // for wire-frame we only need half of the 8 triangles
+
+ //glVertex3f( gp.x+d, gp.y+0, gp.z+0 +z);
+ //glVertex3f( gp.x+0, gp.y+d, gp.z+0 +z);
+ //glVertex3f( gp.x+0, gp.y+0, gp.z-d +z);
+
+ //glVertex3f( gp.x-d, gp.y+0, gp.z+0 +z);
+ //glVertex3f( gp.x+0, gp.y-d, gp.z+0 +z);
+ //glVertex3f( gp.x+0, gp.y+0, gp.z-d +z);
+
+ // and two more...
+
z += sz;
}
}

0 comments on commit e4631ee

Please sign in to comment.