void RenderTree(float x, float y, float scale)
{
// === Leaves (3 circles) ===
float r = 0.2f * scale;
float leafY = y + 0.05f * scale;
// Left circle (darker green)
DrawCircle(x - 0.07f * scale, leafY, r, 0.45f, 0.65f, 0.32f);
// Center circle (lighter green)
DrawCircle(x, leafY + 0.3f, r, 0.55f, 0.80f, 0.40f);
// Right circle (lighter green)
DrawCircle(x + 0.07f * scale, leafY, r, 0.55f, 0.80f, 0.40f);
// === Trunk ===
glColor3f(0.60f, 0.40f, 0.26f); // Brown
float trunkWidth = 0.05f * scale;
float trunkHeight = 0.4f * scale;
glBegin(GL_QUADS);
glVertex2f(x - trunkWidth / 2, y - trunkHeight);
glVertex2f(x + trunkWidth / 2, y - trunkHeight);
glVertex2f(x + trunkWidth / 2, y);
glVertex2f(x - trunkWidth / 2, y);
glEnd();
// === RightBranch (slanted rectangle coming from the middle of trunk) ===
glColor3f(0.60f, 0.40f, 0.26f);
float branchStartX = x - 0.01f;
float branchStartY = y - trunkHeight * 0.3f;
float branchLength = 0.08f * scale;
float branchHeight = 0.15f * scale;
float yOffset = -0.3f;
glBegin(GL_QUADS);
glVertex2f(branchStartX, branchStartY + yOffset);
glVertex2f(branchStartX + branchLength, branchStartY + branchHeight + yOffset);
glVertex2f(branchStartX + branchLength + 0.03f * scale, branchStartY + branchHeight + yOffset);
glVertex2f(branchStartX + 0.03f * scale, branchStartY + yOffset);
glEnd();
// === LeftBranch (flipped horizontally to point left) ===
glColor3f(0.60f, 0.40f, 0.26f);
float branchStartA = x + 0.01f; // start on right side of trunk
float branchStartB = y - trunkHeight * 0.3f;
float branchLength2 = 0.05f * scale;
float branchHeight2 = 0.1f * scale;
float yOffset2 = -0.1f;
glBegin(GL_QUADS);
glVertex2f(branchStartA, branchStartB + yOffset2);
glVertex2f(branchStartA - branchLength2, branchStartB + branchHeight2 + yOffset2);
glVertex2f(branchStartA - branchLength2 - 0.03f * scale, branchStartB + branchHeight2 + yOffset2);
glVertex2f(branchStartA - 0.03f * scale, branchStartB + yOffset2);
glEnd();
}