#endif
/* get color */
opengl_render_color(render_item->u.sky.red, render_item->u.sky.green, render_item->u.sky.blue, 1.0);
- /* create plane to fill view */
- x[0] = x[1] = y[1] = y[2] = -1000000;
- x[2] = x[3] = y[0] = y[3] = 1000000;
- z[0] = z[1] = z[2] = z[3] = 10;
- /* render */
- opengl_render_polygon(x, y, z, 4, 0); /* no culling, because sky (background) is always visible! */
+ /* create box to fill view */
+ x[0] = x[1] = y[1] = y[2] = -1000;
+ x[2] = x[3] = y[0] = y[3] = 1000;
+ z[0] = z[1] = z[2] = z[3] = 1000;
+ opengl_render_polygon_and_line(x, y, z, 4);
+ z[0] = z[1] = z[2] = z[3] = -1000;
+ opengl_render_polygon_and_line(x, y, z, 4);
+ x[0] = x[1] = z[1] = z[2] = -1000;
+ x[2] = x[3] = z[0] = z[3] = 1000;
+ y[0] = y[1] = y[2] = y[3] = 1000;
+ opengl_render_polygon_and_line(x, y, z, 4);
+ y[0] = y[1] = y[2] = y[3] = -1000;
+ opengl_render_polygon_and_line(x, y, z, 4);
+ y[0] = y[1] = z[1] = z[2] = -1000;
+ y[2] = y[3] = z[0] = z[3] = 1000;
+ x[0] = x[1] = x[2] = x[3] = 1000;
+ opengl_render_polygon_and_line(x, y, z, 4);
+ x[0] = x[1] = x[2] = x[3] = -1000;
+ opengl_render_polygon_and_line(x, y, z, 4);
break;
}
case RENDER_ITEM_GROUND:
opengl_render_color(render_item->u.ground.red, render_item->u.ground.green, render_item->u.ground.blue, 1.0);
yaw = 0.0; /* no need to rotate x-z plane, we don't want look at a corner of the 'ground-square' */
/* create huge square */
- x[0] = x[1] = z[1] = z[2] = -1000000;
- x[2] = x[3] = z[0] = z[3] = 1000000;
- y[0] = y[1] = y[2] = y[3] = -10;
+ x[0] = x[1] = z[1] = z[2] = -1000000000;
+ x[2] = x[3] = z[0] = z[3] = 1000000000;
+ y[0] = y[1] = y[2] = y[3] = -1000;
/* rotate vertex */
for (i = 0; i < 4; i++)
rotate_coordinate(roll, pitch, yaw, &x[i], &y[i], &z[i]);