- Documentation
- Client functions
- dxDrawPrimitive3D
Function
dxDrawPrimitive3D
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
dxDrawMaterialPrimitive3DDraws a triangle shape in the 3D world covered with a material. Vertices are{x, y, z, color, u, v}, where u and v (0-1) tell which image point lands on the vertex. The colour of the whole shape comes from the first vertex.dxDrawPrimitiveDraws a 2D shape from a list of{x, y [, color]}vertices: points, lines or triangles. The colour is blended smoothly between vertices.