Fixes for loading paths AND filenames. Added origin x-,y-, and z-axis lines.
This commit is contained in:
		
							
								
								
									
										29
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								main.cpp
									
									
									
									
									
								
							@@ -44,6 +44,31 @@ void draw(const std::vector<Point> &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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user