dxDrawMaterialPrimitive3D
Cliente
Desenha uma primitiva com uma imagem no mundo 3D durante um quadro.
bool dxDrawMaterialPrimitive3D(string primitiveType, texture|dui|string material, table vertex1, vertex2, ... [, string|bool stage = postfx])
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
| primitiveType | string | Tipo de primitiva: pointlist, linelist, linestrip, trianglelist, trianglestrip ou trianglefan. |
| material | texture|dui|string | A imagem (textura, render target, screen source ou dui) ou o caminho de um arquivo de imagem do recurso. |
| stage | string|bool | Quando desenhar: prefx, postfx ou postgui, ou um booleano (true é postgui).padrão postfx |
| vertex1, vertex2, ... | table | Um argumento por vértice: {x, y, z, u, v} ou {x, y, z, color, u, v}, com a posição no mundo e u, v as coordenadas na imagem. |
Retorno
true se o desenho foi enfileirado. false quando a quantidade de vértices não serve para o tipo (por exemplo, trianglelist precisa de um múltiplo de 3). Também false se a imagem não pôde ser carregada.
Exemplo
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)Atenção
prefx e postfx desenham da mesma forma: só postgui muda a camada.