diff --git a/Assets/Scripts/City3D/City3DController.cs b/Assets/Scripts/City3D/City3DController.cs index 00bde43..cc8c7a0 100644 --- a/Assets/Scripts/City3D/City3DController.cs +++ b/Assets/Scripts/City3D/City3DController.cs @@ -142,6 +142,19 @@ public class City3DController : MonoBehaviour go.AddComponent().sharedMaterial = Map3D.TexturedMat(groundTexture); go.AddComponent().sharedMesh = mesh; + // Лес и луга за краем участка: камера не видит пустого неба + Map3D.Block(transform, "OuterLand", PrimitiveType.Cube, new Color(0.24f, 0.4f, 0.22f), new Vector3(n / 2f, -0.7f, n / 2f), + new Vector2(n + 200f, n + 200f), 0.1f); + var forest = new System.Random(7); + for (int i = 0; i < 140; i++) + { + // кольцо деревьев вокруг участка + float angle = (float)forest.NextDouble() * Mathf.PI * 2f, r = n * 0.72f + (float)forest.NextDouble() * 14f; + var p = new Vector3(n / 2f + Mathf.Cos(angle) * r, -0.6f, n / 2f + Mathf.Sin(angle) * r); + if (p.x > 0 && p.x < n && p.z > 0 && p.z < n) continue; // внутри участка -- свои деревья + Map3D.Tree(transform, "ForestTree", p, 1.4f + (float)forest.NextDouble() * 0.8f, forest.Next(6)); + } + // Вода -- плоскость над руслом var water = GameObject.CreatePrimitive(PrimitiveType.Cube); water.name = "River"; diff --git a/Assets/Scripts/WorldMap/WorldMapController.cs b/Assets/Scripts/WorldMap/WorldMapController.cs index 6218411..f904d75 100644 --- a/Assets/Scripts/WorldMap/WorldMapController.cs +++ b/Assets/Scripts/WorldMap/WorldMapController.cs @@ -342,6 +342,10 @@ public class WorldMapController : MonoBehaviour mesh.uv = new[] { new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 1), new Vector2(1, 0) }; mesh.triangles = new[] { 0, 1, 2, 0, 2, 3 }; mesh.RecalculateNormals(); + // Земля за краем карты -- тёмная, как неисследованное: камера под наклоном не видит пустого неба + Map3D.Block(mapRoot, "OuterLand", PrimitiveType.Cube, new Color(0.12f, 0.16f, 0.13f), new Vector3(0, -0.08f, 0), + new Vector2(width + 160f, height + 160f), 0.06f); + var go = new GameObject("Ground"); go.transform.SetParent(mapRoot, false); go.AddComponent().sharedMesh = mesh;