السلام عليكم ورحمة الله وبركاته dxDrawMaterial3D syntax
dxDrawMaterial3D(x,y,z,w,h,Material,images,...)
Material :
"Sphere" see video by medo7
"Box" see video by Ren712
"Triangle"
Source Code:
local images = dxCreateTexture("");
function dxDrawMaterial3D(x,y,z,w,h,Material,images,...)
if Material == "Sphere" then
local segAngle , radius = 360 / 30 , 0.5 ;
local fX, fY, tX, tY;
for i = 1, 360 do
fX = x + math.cos( math.rad( segAngle * i ) ) * radius ;
fY = y + math.sin( math.rad( segAngle * i ) ) * radius ;
tX = x + math.cos( math.rad( segAngle * (i+7) ) ) * radius ;
tY = y + math.sin( math.rad( segAngle * (i+7) ) ) * radius ;
end
w,h = 1 ;
return dxDrawMaterialLine3D(fX, fY, z+h, tX, tY, z+h, images,w,tocolor(0,0,0,100),false) or "Sphere" ;
elseif Material == "Box" then
local w2,h2 = math.floor(4* math.sin( h+ math.rad(100) ) ) ;
return dxDrawMaterialLine3D(x,y,z, w2, h2, z, images, h,tocolor(0,0,0,100),false) or "Box" ;
elseif Material == "Triangle" then
t3 = 360/3 ;
tX2 = x + math.cos( math.rad( t3 * (h+1) ) ) / w ;
tY2 = y + math.sin( math.rad( t3 * (h+1) ) ) / w ;
tZ2 = z + math.tan( math.rad( t3 * (h+1) ) ) / w ;
return dxDrawMaterialLine3D(x,y,z, tX2, tY2, tZ2, images, h,tocolor(0,0,0,100),false) or "Triangle" ;
end
end
Example
addEventHandler("onClientPreRender", root,
function()
dxDrawMaterial3D(0,0,5,5,5,"Sphere","logo.png")
end)