dxDrawMaterialPrimitive3D
Cliente
Dibuja una primitiva con una imagen en el mundo 3D durante un fotograma.
bool dxDrawMaterialPrimitive3D(string primitiveType, texture|dui|string material, table vertex1, vertex2, ... [, string|bool stage = postfx])
Parámetros
| Nombre | Tipo | Descripción |
|---|---|---|
| primitiveType | string | Tipo de primitiva: pointlist, linelist, linestrip, trianglelist, trianglestrip o trianglefan. |
| material | texture|dui|string | La imagen (textura, render target, screen source o dui) o la ruta de un archivo de imagen del recurso. |
| stage | string|bool | Cuándo dibujar: prefx, postfx o postgui, o un booleano (true es postgui).por defecto postfx |
| vertex1, vertex2, ... | table | Un argumento por vértice: {x, y, z, u, v} o {x, y, z, color, u, v}, con la posición en el mundo y u, v las coordenadas en la imagen. |
Retorno
true si el dibujo quedó en cola. false cuando la cantidad de vértices no sirve para el tipo (por ejemplo, trianglelist necesita un múltiplo de 3). También false si la imagen no se pudo cargar.
Ejemplo
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)Atención
prefx y postfx dibujan igual: solo postgui cambia la capa.