) + z * Math.cos(rotationX);

    x = rotatedX * Math.cos(rotationY) + rotatedZ * Math.sin(rotationY);
    y = rotatedY;
    z = -rotatedX * Math.sin(rotationY) + rotatedZ * Math.cos(rotationY);

    // 投影
    const scale = radius / (radius + z + 2);
    return [
        x * scale * radius + canvas.width / 2,
        y * scale * radius + canvas.height / 2
    ];
}

function subdivide(vertices, faces, level) {
    if (level === 0) return { vertices, faces };

    const newVertices = [...vertices];
    co