From db269639388b2d8ebe841dc3842e27ead92d6b24 Mon Sep 17 00:00:00 2001 From: todeskurve <47814519+todeskurve@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:50:07 +0200 Subject: [PATCH] Add C# Example to ImmediateMesh.xml --- doc/classes/ImmediateMesh.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/classes/ImmediateMesh.xml b/doc/classes/ImmediateMesh.xml index bde11a850e5..7e40d0b4c53 100644 --- a/doc/classes/ImmediateMesh.xml +++ b/doc/classes/ImmediateMesh.xml @@ -15,6 +15,14 @@ mesh.surface_add_vertex(Vector3.ZERO) mesh.surface_end() [/gdscript] + [csharp] + var mesh = new ImmediateMesh(); + mesh.SurfaceBegin(Mesh.PrimitiveType.Triangles); + mesh.SurfaceAddVertex(Vector3.Left); + mesh.SurfaceAddVertex(Vector3.Forward); + mesh.SurfaceAddVertex(Vector3.Zero); + mesh.SurfaceEnd(); + [/csharp] [/codeblocks] [b]Note:[/b] Generating complex geometries with [ImmediateMesh] is highly inefficient. Instead, it is designed to generate simple geometry that changes often.