diff options
Diffstat (limited to 'terrain.cpp')
-rw-r--r-- | terrain.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/terrain.cpp b/terrain.cpp index 35aef58..1fd75db 100644 --- a/terrain.cpp +++ b/terrain.cpp @@ -73,6 +73,19 @@ void Terrain::Node::fill() { vertex_array[11] = y; } +void Terrain::Node::draw() { + glBegin(GL_TRIANGLES); + for(int i = 0; i < 2; i++) { + glTexCoord2f(0, 0); + glVertex3f(vertex_array[0], vertex_array[1], vertex_array[2]); + glTexCoord2f(i, 1); + glVertex3f(vertex_array[i*3+3], vertex_array[i*3+4], vertex_array[i*3+5]); + glTexCoord2f(1, 1-i); + glVertex3f(vertex_array[i*3+6], vertex_array[i*3+7], vertex_array[i*3+8]); + } + glEnd(); +} + void Terrain::Node::draw_grid() { glNormal3f(0, 1, 0); glBegin(GL_LINE_LOOP); |