Lines Matching refs:n
83 void rt_heightfield(void *tex, vector ctr, int m, int n, apiflt *field, apiflt wx, apiflt wy) { in rt_heightfield() argument
92 for (yy = 0; yy < (n - 1); yy++) { in rt_heightfield()
96 v0.z = wy * (yy) / (n * 1.0) + yoff; in rt_heightfield()
100 v1.z = wy * (yy) / (n * 1.0) + yoff; in rt_heightfield()
104 v2.z = wy * (yy + 1) / (n * 1.0) + yoff; in rt_heightfield()
110 v0.z = wy * (yy) / (n * 1.0) + yoff; in rt_heightfield()
114 v1.z = wy * (yy + 1) / (n * 1.0) + yoff; in rt_heightfield()
118 v2.z = wy * (yy + 1) / (n * 1.0) + yoff; in rt_heightfield()
126 rt_sheightfield(void *tex, vector ctr, int m, int n, apiflt *field, apiflt wx, apiflt wy) { in rt_sheightfield() argument
133 vertices = (vector *)malloc(m * n * sizeof(vector)); in rt_sheightfield()
134 normals = (vector *)malloc(m * n * sizeof(vector)); in rt_sheightfield()
141 yinc = wy / ((apiflt)n); in rt_sheightfield()
144 for (y = 0; y < n; y++) { in rt_sheightfield()
154 normals[x] = normals[(n - 1) * m + x] = rt_vector(0.0, 1.0, 0.0); in rt_sheightfield()
156 for (y = 1; y < n; y++) { in rt_sheightfield()
159 for (y = 1; y < (n - 1); y++) { in rt_sheightfield()
172 for (y = 0; y < (n - 1); y++) { in rt_sheightfield()
252 void rt_landscape(void *tex, int m, int n, vector ctr, apiflt wx, apiflt wy) { in rt_landscape() argument
256 totalsize = m * n; in rt_landscape()
262 for (y = 0; y < n; y++) { in rt_landscape()
270 field[0 + m * (n - 1)] = 1.0 + (rand() % 100) / 100.0; in rt_landscape()
271 field[m - 1 + m * (n - 1)] = 1.0 + (rand() % 100) / 100.0; in rt_landscape()
273 subdivide(field, m, n, wx, wy, 0, 0, m - 1, n - 1); in rt_landscape()
275 rt_sheightfield(tex, ctr, m, n, field, wx, wy); in rt_landscape()