diff --git a/control.c b/control.c index e33c378..a6bc77e 100644 --- a/control.c +++ b/control.c @@ -18,7 +18,7 @@ int collision(struct chunk chunk, vec3 pos, vec3 dir_temp, int col, int n) { return 1; } if (yd < 0 && n == 1) { - dir_temp[1] = 0; + dir_temp[1] = 0.015; pos[1] = closestVert[1]; return 1; } @@ -66,9 +66,9 @@ struct v3f control_handler(double cx, double cy, vec3 pos, vec3 dir_temp, for (int a = -2; a < 0; a++) { off[1] = a; for (int b = -1; b < 1; b++) { - off[0] = b + 0.5; + off[0] = (b + 0.5)*0.95; for (int c = -1; c < 1; c++) { - off[2] = c + 0.5; + off[2] = (c + 0.5)*0.95; col = col || gen_cube(pos[0] + off[0], pos[1] + off[1], pos[2] + off[2], chunk, 0, -1); } @@ -82,9 +82,9 @@ struct v3f control_handler(double cx, double cy, vec3 pos, vec3 dir_temp, off[1] = -2; for (int b = -1; b < 1; b++) { - off[0] = b + 0.5; + off[0] = (b + 0.5)*0.95; for (int c = -1; c < 1; c++) { - off[2] = c + 0.5; + off[2] = (c + 0.5)*0.95; col = col || gen_cube(pos[0] + off[0], pos[1] + off[1], pos[2] + off[2], chunk, 0, -1); } diff --git a/cubes.c b/cubes.c index 3cda73e..f8090d1 100644 --- a/cubes.c +++ b/cubes.c @@ -40,10 +40,10 @@ void cubes_rect(struct v3f *cube, int *i, double x1, double x2, double y1, d.pos[0] += TEXT_GAP_H; d.pos[1] += TEXT_GAP_V; } else { - b.pos[0]++; - c.pos[1]++; - d.pos[0]++; - d.pos[1]++; + b.pos[0] = x2; + c.pos[1] = y2; + d.pos[0] = x2; + d.pos[1] = y2; } cube[*i] = a2; diff --git a/main.c b/main.c index 71c58ca..62ce688 100644 --- a/main.c +++ b/main.c @@ -354,9 +354,18 @@ int main(void) { glUniform1i(use_shading, 0); int iz = CBLOCK_ALL * 18; + int iz2 = iz; cubes_rect(cubeO, &iz, -0.5, 0.5, -0.5, 0.5, 0, 0, 6); cubes_rect(textO, &iz, -0.5, 0.5, -0.5, 0.5, 1, 0, 6); + for (int i = 0; i < 10; i++) { + iz += 6; + cubes_rect(cubeO, &iz, ((i - 4.5) * 2.5) - 1, ((i - 4.5) * 2.5) + 1, -11, + -9, 0, 1, 6); + cubes_rect(textO, &iz, ((i - 4.5) * 2.5) - 1, ((i - 4.5) * 2.5) + 1, -11, + -9, 1, 1, 6); + } + mat4x4_identity(v); mat4x4_ortho(p, -ratio * 15, ratio * 15, -1.f * 15, 1.f * 15, 1.0f, -1.0f); mat4x4_mul(mvp, p, v); @@ -365,15 +374,15 @@ int main(void) { glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat *)&mvp); glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer[1]); - glBufferSubData(GL_ARRAY_BUFFER, CTRI_ALL, (long)6 * sizeof(struct v3f), - &textO[iz]); + glBufferSubData(GL_ARRAY_BUFFER, CTRI_ALL, + (long)6 * 11 * sizeof(struct v3f), &textO[iz2]); glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer[0]); - glBufferSubData(GL_ARRAY_BUFFER, CTRI_ALL, (long)6 * sizeof(struct v3f), - &cubeO[iz]); + glBufferSubData(GL_ARRAY_BUFFER, CTRI_ALL, + (long)6 * 11 * sizeof(struct v3f), &cubeO[iz2]); glBindVertexArray(vertex_array); - glDrawArrays(GL_TRIANGLES, CBLOCK_ALL * 18, 6); + glDrawArrays(GL_TRIANGLES, CBLOCK_ALL * 18, 6 * 11); } if (fp) { diff --git a/test.png b/test.png index 741d2a0..af944e4 100644 Binary files a/test.png and b/test.png differ