Skip to content

Commit

Permalink
Merge pull request #76470 from MewPurPur/add-immediate-mesh-example
Browse files Browse the repository at this point in the history
Provide an example on how to use ImmediateMesh
  • Loading branch information
akien-mga committed Apr 26, 2023
2 parents e1075e9 + 4eabad6 commit 6bf94cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/classes/Expression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
[/codeblocks]
</description>
<tutorials>
<link title="Evaluating Expressions">$DOCS_URL/tutorials/scripting/evaluating_expressions.html</link>
</tutorials>
<methods>
<method name="execute">
Expand Down
13 changes: 12 additions & 1 deletion doc/classes/ImmediateMesh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
Mesh optimized for creating geometry manually.
</brief_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>
<tutorials>
<link title="Using ImmediateMesh">$DOCS_URL/tutorials/3d/procedural_geometry/immediatemesh.html</link>
</tutorials>
<methods>
<method name="clear_surfaces">
Expand Down

0 comments on commit 6bf94cf

Please sign in to comment.