- private void DrawMapParts(float x, float y, int size)
- {
- if (size == 1)
- {
- //Zeichne TriangleFan
- GL.Begin(OpenGL.BeginMode.TriangleFan);
- {
- GL.Vertex3(x - 1f, y - 1f, 0.0f);
- GL.Vertex3(x + 1f, y - 1f, 0.0f);
- GL.Vertex3(x + 1f, y + 1f, 0.0f);
- GL.Vertex3(x - 1f, y + 1f, 0.0f);
- }
- GL.End();
- }
- else
- {
- //Unterteile in 4 kleinere Ecken
- DrawMapParts(x / 2.0f + size / 2.0f, y / 2.0f + size / 2.0f, size / 2);
- DrawMapParts(x / 2.0f + size / 2.0f, y / 2.0f - size / 2.0f, size / 2);
- DrawMapParts(x / 2.0f - size / 2.0f, y / 2.0f + size / 2.0f, size / 2);
- DrawMapParts(x / 2.0f - size / 2.0f, y / 2.0f - size / 2.0f, size / 2);
- }
- }