diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
commit | a79414bcf14d17c58e040a7b8524f7bd8f7e5e03 (patch) | |
tree | 4f2f232aca568711ecb35caa3444b54f4dfa4361 /stltogl |
Migrate from gists
Diffstat (limited to 'stltogl')
-rw-r--r-- | stltogl | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +"Get rid of most of the bumpf in the file +:g/solid/d +:g/loop/d +:g/endfacet/d +"Get rid of leading and trailing spaces +:%s/^ *//g +:%s/ *$//g +"Unify spaces +:%s/ \+/ /g +"Rewrite each facet normal into a glNormal3f +:%s/facet normal /glNormal3f(/g +"Rewrite each vertex into a glVertex3f +:%s/vertex /glVertex3f(/g +"Rewrite line endings into function endings +"and separate arguments +:%s/$/);/g +:%s/ /, /g +"Colour each vertex +:%s/\v(glV.*\n)(glV.*\n)(glV.*\n)/glColor3f(1.0, 0.0, 0.0); \1glColor3f(0.0, 1.0, 0.0); \2glColor3f(0.0, 0.0, 1.0); \3/g +"Get rid of blank lines +:g/^$/d |