dxDrawPrimitive3D | Multi Theft Auto: Wiki Skip to content

dxDrawPrimitive3D

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function draws a 3D primitive in the 3D world - rendered for one frame. This should be used in conjunction with onClientRender in order to display continuously.

Syntax

bool dxDrawPrimitive3D ( string primitiveType, string stage, table vertex1, table vertex2, table vertex3, table vertex4, unknown ... )
Required Arguments
  • primitiveType: The type of primitive to be drawn. This could be:
  • stage: MISSING_PARAM_DESC
  • vertex1: MISSING_PARAM_DESC
  • vertex2: MISSING_PARAM_DESC
  • vertex3: MISSING_PARAM_DESC
  • vertex4: MISSING_PARAM_DESC
  • ...: MISSING_PARAM_DESC

Returns

  • bool: value

Returns a true if the operation was successful, false otherwise.

Code Examples

shared

This is a small example of creating 3D Primitive object with 4 vertex that will spawn on 'The Well Stacked Pizza Co.' in Idlewood.

local primitive = {
{2087.8, -1804.2, 13.5, tocolor(255, 0, 0)},
{2087.7, -1810.5, 13.5, tocolor(0, 255, 0)},
{2092.7, -1813.6, 17.7, tocolor(0, 0, 255)},
{2097.5, -1806.8, 16, tocolor(255, 255, 255)}
}
function draw()
dxDrawPrimitive3D("trianglefan", false, unpack(primitive))
end
addEventHandler("onClientRender", root, draw)