From: havoc Date: Fri, 11 Jul 2003 07:44:17 +0000 (+0000) Subject: added a note about another kind of terrain strip and documented code for generating... X-Git-Tag: xonotic-v0.1.0preview~6548 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=322a793217747dcba07746dbe23006dcb50492a2;p=xonotic%2Fdarkplaces.git added a note about another kind of terrain strip and documented code for generating the strips git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3227 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_backend.c b/gl_backend.c index 833bdb1b..fe474eac 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -91,6 +91,7 @@ note: here's strip order for a terrain row: |\ |\ |\ |\ | | \| \| \| \| A--B--C--D--E +clockwise A0B, 01B, B1C, 12C, C2D, 23D, D3E, 34E @@ -100,6 +101,42 @@ A0B, 01B, B1C, 12C, C2D, 23D, D3E, 34E *elements++ = i; *elements++ = i + 1; *elements++ = i + row + 1; + + +for (y = 0;y < rows - 1;y++) +{ + for (x = 0;x < columns - 1;x++) + { + i = y * rows + x; + *elements++ = i + columns; + *elements++ = i; + *elements++ = i + columns + 1; + *elements++ = i; + *elements++ = i + 1; + *elements++ = i + columns + 1; + } +} + +alternative: +0--1--2--3--4 +| /| /|\ | /| +|/ |/ | \|/ | +A--B--C--D--E +counterclockwise + +for (y = 0;y < rows - 1;y++) +{ + for (x = 0;x < columns - 1;x++) + { + i = y * rows + x; + *elements++ = i; + *elements++ = i + columns; + *elements++ = i + columns + 1; + *elements++ = i + columns; + *elements++ = i + columns + 1; + *elements++ = i + 1; + } +} */ int polygonelements[768];