ImmediateGeometry

    Draws simple geometry from code.

    Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.

    See also , MeshDataTool and 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, or SurfaceTool instead.

    Note: Godot uses clockwise for front faces of triangle primitive modes.

    Simple helper to draw an UV sphere with given latitude, longitude and radius.


    • void add_vertex ( Vector3 position )

    Adds a vertex in local coordinate space with the currently set color/uv/etc.


    • void begin ( primitive, Texture texture=null )

    Begin drawing (and optionally pass a texture override). When done call . For more information on how this works, search for and glEnd() references.

    For the type of primitive, see the PrimitiveType enum.


    • void clear ( )

    Clears everything that was drawn using begin/end.



    • void set_color ( color )

    The current drawing color.


    • void set_normal ( Vector3 normal )

    The next vertex’s normal.


    • void set_tangent ( tangent )

    The next vertex’s tangent (and binormal facing).


    The next vertex’s UV.


    The next vertex’s second layer UV.