Fixes for loading paths AND filenames. Added origin x-,y-, and z-axis lines.

This commit is contained in:
David Vereb 2021-03-14 00:07:21 -05:00
parent b4d841e41a
commit 508cf7238e

View File

@ -44,6 +44,31 @@ void draw(const std::vector<Point> &points)
glutPostRedisplay(); 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() void display()
{ {
// RESET: // RESET:
@ -58,6 +83,8 @@ void display()
0.0, 6.0, 0.0, /* center is at */ 0.0, 6.0, 0.0, /* center is at */
0.0, 1.0, 0.0); /* up is in positive Y direction */ 0.0, 1.0, 0.0); /* up is in positive Y direction */
draw_origin();
// DRAW TRACKS: // DRAW TRACKS:
for(auto track : tracks) for(auto track : tracks)
draw(track); draw(track);
@ -105,7 +132,7 @@ int main(int argc, char *argv[])
{ {
auto extension = entry.path().extension(); auto extension = entry.path().extension();
if(extension == ".gpx") if(extension == ".gpx")
files.push_back(entry.path().filename()); files.push_back(entry.path().string());
} }
float file_diff_lat = -8; float file_diff_lat = -8;