From 508cf7238e750ab90e5d381c02c7a712364f1c90 Mon Sep 17 00:00:00 2001 From: David Vereb Date: Sun, 14 Mar 2021 00:07:21 -0500 Subject: [PATCH] Fixes for loading paths AND filenames. Added origin x-,y-, and z-axis lines. --- main.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index ae41cf3..6ae7c06 100644 --- a/main.cpp +++ b/main.cpp @@ -44,6 +44,31 @@ void draw(const std::vector &points) glutPostRedisplay(); } +void draw_origin() +{ + glBegin(GL_LINES); + + // X: + glColor3d(255, 0, 0); + glVertex3f(-1.0f, 0.0f, 0.0f); + glColor3d(0, 0, 0); + glVertex3f(10.0f, 0.0f, 0.0f); + + // Y: + glColor3d(0, 255, 0); + glVertex3f(0.0f, -1.0f, 0.0f); + glColor3d(0, 0, 0); + glVertex3f(0.0f, 10.0f, 0.0f); + + // Z: + glColor3d(0, 0, 255); + glVertex3f(0.0f, 0.0f, -10.0f); + glColor3d(0, 0, 0); + glVertex3f(0.0f, 0.0f, 10.0f); + + glEnd(); +} + void display() { // RESET: @@ -58,6 +83,8 @@ void display() 0.0, 6.0, 0.0, /* center is at */ 0.0, 1.0, 0.0); /* up is in positive Y direction */ + draw_origin(); + // DRAW TRACKS: for(auto track : tracks) draw(track); @@ -105,7 +132,7 @@ int main(int argc, char *argv[]) { auto extension = entry.path().extension(); if(extension == ".gpx") - files.push_back(entry.path().filename()); + files.push_back(entry.path().string()); } float file_diff_lat = -8;