Creating a grid mesh programmatically in Unity 3D

using System; using System.Collections.Generic; using UnityEngine; public static class Grid { public static void Create(bool withCollision) { GameObject gridObject = new GameObject(); gridObject.name = “Grid”; gridObject.transform.position = Vector3.zero; List<int> triangles = new List<int>(); List<Vector3> vertices = new List<Vector3>(); List<Vector2> uvs = new List<Vector2>(); List<int> collision_triangles…

Mesh Optimization

Below is my custom version of a greedy mesh optimizer for voxel data in Unity3d translated from JavaScript to c# using the original awesome mind bending code of Mikola Lysenko. This is useful if you need to use mesh for collision data and it can…