Refreshing Cache...

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.


voidadd_sphere ( int lats, int lons, float radius, bool add_uv=true )
voidadd_vertex ( Vector3 position )
voidbegin ( PrimitiveType primitive, Texture texture=null )
voidclear ( )
voidend ( )
voidset_color ( Color color )
voidset_normal ( Vector3 normal )
voidset_tangent ( Plane tangent )
voidset_uv ( Vector2 uv )
voidset_uv2 ( Vector2 uv )

Method Descriptions

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.

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.

  • void clear ( )

Clears everything that was drawn using begin/end.

  • void end ( )

Ends a drawing context and displays the results.

  • void set_color ( Color color )

The current drawing color.

The next vertex’s normal.

  • void set_tangent ( Plane tangent )

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

The next vertex’s UV.

The next vertex’s second layer UV.

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:33:43. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.