summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--height-map-display/src/main.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/height-map-display/src/main.c b/height-map-display/src/main.c
index 7e985d0..98b7198 100644
--- a/height-map-display/src/main.c
+++ b/height-map-display/src/main.c
@@ -66,8 +66,8 @@ void renderHeightMap(Square **squares) {
glBegin(GL_QUADS);
glVertex3f(x, squares[x][y].node_tl->elevation * scale_factor, y);
glVertex3f(x + 1, squares[x][y].node_tr->elevation * scale_factor, y);
- glVertex3f(x + 1, squares[x][y].node_bl->elevation * scale_factor, y + 1);
- glVertex3f(x, squares[x][y].node_br->elevation * scale_factor, y + 1);
+ glVertex3f(x + 1, squares[x][y].node_br->elevation * scale_factor, y + 1);
+ glVertex3f(x, squares[x][y].node_bl->elevation * scale_factor, y + 1);
glEnd();
}
@@ -78,7 +78,7 @@ void renderHeightMap(Square **squares) {
logger("Init grid...");
if (draw_grid) {
glColor3f(0.0f, 0.0f, 0.0f);
- glLineWidth(1.0f);
+ glLineWidth(3.0f);
glBegin(GL_LINES);
for (int x = 0; x <= MAP_WIDTH - 2; x++) {
@@ -201,33 +201,6 @@ int main(int argc, char *argv[]) {
change_square_height(&squares[5][5], -5.0f);
change_square_terrain(&squares[5][5], TERRAIN_FAIRWAY);
- printf("Node 33 tl x = %i\n", squares[3][3].node_tr->x);
- printf("Node 33 tl y = %i\n", squares[3][3].node_tr->y);
- printf("Node 33 tr x = %i\n", squares[3][3].node_tl->x);
- printf("Node 33 tr y = %i\n", squares[3][3].node_tl->y);
- printf("Node 33 br x = %i\n", squares[3][3].node_br->x);
- printf("Node 33 br y = %i\n", squares[3][3].node_br->y);
- printf("Node 33 bl x = %i\n", squares[3][3].node_bl->x);
- printf("Node 33 bl y = %i\n", squares[3][3].node_bl->y);
-
- printf("Node 34 tl x = %i\n", squares[3][4].node_tr->x);
- printf("Node 34 tl y = %i\n", squares[3][4].node_tr->y);
- printf("Node 34 tr x = %i\n", squares[3][4].node_tl->x);
- printf("Node 34 tr y = %i\n", squares[3][4].node_tl->y);
- printf("Node 34 br x = %i\n", squares[3][4].node_br->x);
- printf("Node 34 br y = %i\n", squares[3][4].node_br->y);
- printf("Node 34 bl x = %i\n", squares[3][4].node_bl->x);
- printf("Node 34 bl y = %i\n", squares[3][4].node_bl->y);
-
- printf("Node 43 tl x = %i\n", squares[4][3].node_tr->x);
- printf("Node 43 tl y = %i\n", squares[4][3].node_tr->y);
- printf("Node 43 tr x = %i\n", squares[4][3].node_tl->x);
- printf("Node 43 tr y = %i\n", squares[4][3].node_tl->y);
- printf("Node 43 br x = %i\n", squares[4][3].node_br->x);
- printf("Node 43 br y = %i\n", squares[4][3].node_br->y);
- printf("Node 43 bl x = %i\n", squares[4][3].node_bl->x);
- printf("Node 43 bl y = %i\n", squares[4][3].node_bl->y);
-
while (!glfwWindowShouldClose(window)) {
logger("Entering main loop...");
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -237,7 +210,7 @@ int main(int argc, char *argv[]) {
glfwSwapBuffers(window); // Swap buffers to display the rendered image
- camera_yaw = camera_yaw + 0.5f;
+ camera_yaw = camera_yaw + 0.1f;
// Poll for and process events, wait for events if none are pending
glfwWaitEventsTimeout(0.01); // Add a slight delay to reduce CPU usage
}