:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ImmediateGeometry.xml. .. _class_ImmediateGeometry: ImmediateGeometry ================= **Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` Draws simple geometry from code. .. rst-class:: classref-introduction-group Description ----------- Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x. See also :ref:`ArrayMesh`, :ref:`MeshDataTool` and :ref:`SurfaceTool` for procedural geometry generation. \ **Note:** ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use :ref:`ArrayMesh`, :ref:`MeshDataTool` or :ref:`SurfaceTool` instead. \ **Note:** Godot uses clockwise `winding order `__ for front faces of triangle primitive modes. \ **Note:** In case of missing points when handling large amounts of mesh data, try increasing its buffer size limit under :ref:`ProjectSettings.rendering/limits/buffers/immediate_buffer_size_kb`. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_sphere` **(** :ref:`int` lats, :ref:`int` lons, :ref:`float` radius, :ref:`bool` add_uv=true **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_vertex` **(** :ref:`Vector3` position **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`begin` **(** :ref:`PrimitiveType` primitive, :ref:`Texture` texture=null **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`end` **(** **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color` **(** :ref:`Color` color **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_normal` **(** :ref:`Vector3` normal **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tangent` **(** :ref:`Plane` tangent **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_uv` **(** :ref:`Vector2` uv **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_uv2` **(** :ref:`Vector2` uv **)** | +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ImmediateGeometry_method_add_sphere: .. rst-class:: classref-method void **add_sphere** **(** :ref:`int` lats, :ref:`int` lons, :ref:`float` radius, :ref:`bool` add_uv=true **)** Simple helper to draw an UV sphere with given latitude, longitude and radius. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_add_vertex: .. rst-class:: classref-method void **add_vertex** **(** :ref:`Vector3` position **)** Adds a vertex in local coordinate space with the currently set color/uv/etc. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_begin: .. rst-class:: classref-method void **begin** **(** :ref:`PrimitiveType` primitive, :ref:`Texture` texture=null **)** Begin drawing (and optionally pass a texture override). When done call :ref:`end`. For more information on how this works, search for ``glBegin()`` and ``glEnd()`` references. For the type of primitive, see the :ref:`PrimitiveType` enum. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_clear: .. rst-class:: classref-method void **clear** **(** **)** Clears everything that was drawn using begin/end. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_end: .. rst-class:: classref-method void **end** **(** **)** Ends a drawing context and displays the results. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_set_color: .. rst-class:: classref-method void **set_color** **(** :ref:`Color` color **)** The current drawing color. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_set_normal: .. rst-class:: classref-method void **set_normal** **(** :ref:`Vector3` normal **)** The next vertex's normal. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_set_tangent: .. rst-class:: classref-method void **set_tangent** **(** :ref:`Plane` tangent **)** The next vertex's tangent (and binormal facing). .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_set_uv: .. rst-class:: classref-method void **set_uv** **(** :ref:`Vector2` uv **)** The next vertex's UV. .. rst-class:: classref-item-separator ---- .. _class_ImmediateGeometry_method_set_uv2: .. rst-class:: classref-method void **set_uv2** **(** :ref:`Vector2` uv **)** The next vertex's second layer UV. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`