… | |
… | |
5 | void draw_flat (GLfloat dx, GLfloat dy, GLfloat dz, GLfloat nx, GLfloat ny, GLfloat nz, |
5 | void draw_flat (GLfloat dx, GLfloat dy, GLfloat dz, GLfloat nx, GLfloat ny, GLfloat nz, |
6 | GLfloat x1, GLfloat h1, GLfloat y1) |
6 | GLfloat x1, GLfloat h1, GLfloat y1) |
7 | { |
7 | { |
8 | vector<vertex_t2f_n3f_v3f> pts; |
8 | vector<vertex_t2f_n3f_v3f> pts; |
9 | pts.resize(4); |
9 | pts.resize(4); |
10 | pts[0] = vertex_t2f_n3f_v3f (point (0, 0, 0), vec3 (nx, nz, ny), tex2 (0, 0)); |
10 | pts[0] = vertex_t2f_n3f_v3f (point (0, 0, 0), -vec3 (nx, nz, ny), tex2 (0, 0)); |
11 | pts[1] = vertex_t2f_n3f_v3f (point (dx, 0, dy), vec3 (nx, nz, ny), tex2 (0, 1)); |
11 | pts[1] = vertex_t2f_n3f_v3f (point (dx, 0, dy), -vec3 (nx, nz, ny), tex2 (0, 1)); |
12 | pts[2] = vertex_t2f_n3f_v3f (point (dx, dz, dy), vec3 (nx, nz, ny), tex2 (1, 1)); |
12 | pts[2] = vertex_t2f_n3f_v3f (point (dx, dz, dy), -vec3 (nx, nz, ny), tex2 (1, 1)); |
13 | pts[3] = vertex_t2f_n3f_v3f (point (0, dz, 0), vec3 (nx, nz, ny), tex2 (1, 0)); |
13 | pts[3] = vertex_t2f_n3f_v3f (point (0, dz, 0), -vec3 (nx, nz, ny), tex2 (1, 0)); |
14 | |
14 | |
15 | geometry_quads *q = new geometry_quads; |
15 | geometry_quads *q = new geometry_quads; |
16 | q->m = new simple_material; |
16 | q->m = new simple_material; |
17 | q->set (pts); |
17 | q->set (pts); |
18 | entity *e = new entity (q); |
18 | entity *e = new entity (q); |