TriangleNet下载如下:
效果如下:

代码参考如下:
using System.Collections.Generic;
using UnityEngine;
using TriangleNet.Geometry;
public class TestTriangleNet : MonoBehaviour
{
[SerializeField]
Material material;
void Start()
{
Vector3[] vs = new Vector3[625];
for (int i = 0; i < vs.Length; i++)
{
vs[i] = new Vector3(i % 25, 0, i / 25);
}
Polygon poly = new();
foreach (var v in vs)
{
poly.Add(new Vertex(v.x, v.z));
}
//设置外轮廓
Vertex[] vertexOut = new Vertex[] { new(1, 10), new(3, 16), new(10, 19), new(16, 16), new(19, 10), new(16, 3), new(10, 1), new(3, 8) };
poly.Add(new Contour(vertexOut), false);
//设置洞洞1
Vertex[] vertexIn01 = new Vertex[] { new(2, 10), new(4, 12)


903

被折叠的 条评论
为什么被折叠?



