aboutsummaryrefslogtreecommitdiff
path: root/stltogl
blob: 5c75287cd8923f9b02c83dd97316605eb587ec89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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