Inherits: GeometryInstance < VisualInstance < Spatial < Node < Object

Category: Core

Brief Description

Draws simple geometry from code.

Member Functions

void add_sphere ( int lats, int lons, float radius, bool add_uv=true )
void add_vertex ( Vector3 position )
void begin ( int 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 )


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

Member Function Description

Simple helper to draw a uvsphere, with given latitudes, longitude and radius.

  • void add_vertex ( Vector3 position )

Adds a vertex with the currently set color/uv/etc.

  • void begin ( int primitive, Texture texture=null )

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

For the type of primitive, use the Mesh.PRIMITIVE_* enumerations.

  • 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.

  • void set_normal ( Vector3 normal )

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.