Draws simple geometry from code.
    public class ImmediateGeometry : GeometryInstance

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

Inheritance Chain


    public ImmediateGeometry()


    public void AddSphere(int lats, int lons, float radius, bool addUv = true)

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

    public void AddVertex(Vector3 position)

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

    public void Begin(Mesh.PrimitiveType 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.

    public void Clear()

Clears everything that was drawn using begin/end.

    public void End()

Ends a drawing context and displays the results.

    public void SetColor(Color color)

The current drawing color.

    public void SetNormal(Vector3 normal)

The next vertex’s normal.

    public void SetTangent(Plane tangent)

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

    public void SetUv(Vector2 uv)

The next vertex’s UV.

    public void SetUv2(Vector2 uv)

The next vertex’s second layer UV.