Provide an example on how to use ImmediateMesh

(cherry picked from commit 4eabad6c26)
This commit is contained in:
VolTer 2023-04-26 11:58:13 +02:00 committed by Yuri Sizov
parent 56110a354c
commit 7f09c3d2fc
2 changed files with 13 additions and 1 deletions

View File

@ -49,6 +49,7 @@
[/codeblocks] [/codeblocks]
</description> </description>
<tutorials> <tutorials>
<link title="Evaluating Expressions">$DOCS_URL/tutorials/scripting/evaluating_expressions.html</link>
</tutorials> </tutorials>
<methods> <methods>
<method name="execute"> <method name="execute">

View File

@ -4,9 +4,20 @@
Mesh optimized for creating geometry manually. Mesh optimized for creating geometry manually.
</brief_description> </brief_description>
<description> <description>
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.
</description> </description>
<tutorials> <tutorials>
<link title="Using ImmediateMesh">$DOCS_URL/tutorials/3d/procedural_geometry/immediatemesh.html</link>
</tutorials> </tutorials>
<methods> <methods>
<method name="clear_surfaces"> <method name="clear_surfaces">