Inherits: GeometryInstance < VisualInstance < Spatial < Node < Object
Draws simple geometry from code.
Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
See also ArrayMesh, MeshDataTool and 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 ArrayMesh, MeshDataTool or SurfaceTool instead.
Note: Godot uses clockwise winding order for front faces of triangle primitive modes.
void | add_sphere ( int lats, int lons, float radius, bool add_uv=true ) |
void | add_vertex ( Vector3 position ) |
void | begin ( PrimitiveType primitive, Texture texture=null ) |
void | clear ( ) |
void | end ( ) |
void | set_color ( Color color ) |
void | set_normal ( Vector3 normal ) |
void | set_tangent ( Plane tangent ) |
void | set_uv ( Vector2 uv ) |
void | set_uv2 ( Vector2 uv ) |
Simple helper to draw an UV sphere with given latitude, longitude and radius.
Adds a vertex in local coordinate space with the currently set color/uv/etc.
Begin drawing (and optionally pass a texture override). When done call end. For more information on how this works, search for glBegin()
and glEnd()
references.
For the type of primitive, see the PrimitiveType enum.
Clears everything that was drawn using begin/end.
Ends a drawing context and displays the results.
The current drawing color.
The next vertex's normal.
The next vertex's tangent (and binormal facing).
The next vertex's UV.
The next vertex's second layer UV.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_immediategeometry.html