From 4eabad6c265c0c068b5ab2c26e911ac99cd03c3b Mon Sep 17 00:00:00 2001 From: VolTer Date: Wed, 26 Apr 2023 11:58:13 +0200 Subject: [PATCH] Provide an example on how to use ImmediateMesh --- doc/classes/Expression.xml | 1 + doc/classes/ImmediateMesh.xml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index 0796e837b22..ff04440a04f 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -49,6 +49,7 @@ [/codeblocks] + $DOCS_URL/tutorials/scripting/evaluating_expressions.html diff --git a/doc/classes/ImmediateMesh.xml b/doc/classes/ImmediateMesh.xml index 504076e3fee..cd6cb32d3ef 100644 --- a/doc/classes/ImmediateMesh.xml +++ b/doc/classes/ImmediateMesh.xml @@ -4,9 +4,20 @@ Mesh optimized for creating geometry manually. - Mesh optimized for creating geometry manually, similar to OpenGL1.x immediate mode. + A mesh type optimized for creating geometry manually, similar to OpenGL 1.x immediate mode. + Here's a sample on how to generate a triangular face: + [codeblocks] + var mesh = ImmediateMesh.new() + mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES) + mesh.surface_add_vertex(Vector3.LEFT) + mesh.surface_add_vertex(Vector3.FORWARD) + mesh.surface_add_vertex(Vector3.ZERO) + mesh.surface_end() + [/codeblocks] + [b]Note:[/b] Generating complex geometries with [ImmediateMesh] is highly inefficient. Instead, it is designed to generate simple geometry that changes often. + $DOCS_URL/tutorials/3d/procedural_geometry/immediatemesh.html