dxDrawMaterialPrimitive3D
Client
Draws a primitive with an image in the 3D world for one frame.
bool dxDrawMaterialPrimitive3D(string primitiveType, texture|dui|string material, table vertex1, vertex2, ... [, string|bool stage = postfx])
Parameters
| Name | Type | Description |
|---|---|---|
| primitiveType | string | Primitive type: pointlist, linelist, linestrip, trianglelist, trianglestrip or trianglefan. |
| material | texture|dui|string | The image (a texture, render target, screen source or dui) or the path of an image file in the resource. |
| stage | string|bool | When to draw: prefx, postfx or postgui, or a boolean (true means postgui).default postfx |
| vertex1, vertex2, ... | table | One argument per vertex: {x, y, z, u, v} or {x, y, z, color, u, v}, the position in the world and u, v the coordinates in the image. |
Returns
true once the drawing is queued. false when the number of vertices does not fit the type (for example, trianglelist needs a multiple of 3). Also false when the image could not be loaded.
Example
local tex = engineCreateTexture("images/floor.png")
addEventHandler("onClientRender", root, function()
dxDrawMaterialPrimitive3D("trianglestrip", tex, "postfx",
{ 2490, -1670, 13.6, 0, 0 },
{ 2494, -1670, 13.6, 1, 0 },
{ 2490, -1666, 13.6, 0, 1 },
{ 2494, -1666, 13.6, 1, 1 })
end)Note
prefx and postfx draw the same way: only postgui changes the layer.