ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. dxDrawPrimitive3D

Function

dxDrawPrimitive3D

ClientDrawing (dx)Identical to MTA:SA

Draws a shape made of triangles in the 3D world from {x, y, z, color} vertices. The whole shape has the colour of the first vertex.

Syntax

bool dxDrawPrimitive3D(string primitiveType, bool postGUI, table vertex1 [, table ...])

Arguments

primitiveTypestring
"trianglelist", "trianglestrip", "trianglefan".
postGUIbool
Accepted for compatibility with existing scripts.
vertex1table
A vertex {x, y, z, color}.
...table, optional
More vertices.

Returns

true if drawn.

Example

A red triangle above Grove Street.

addEventHandler("onClientRender", root, function()
    local c = tocolor(255, 0, 0, 180)
    dxDrawPrimitive3D("trianglelist", false,
        { 2490, -1690, 20, c }, { 2500, -1690, 20, c }, { 2495, -1680, 25, c })
end)

See also