Jump to content

dxDrawMaterialLine3D هل ممكن يتحول الى شكل دائري؟


Recommended Posts

السلام عليكم,

البوست متكرر في القسم الانجليزي بس ماحد رد.

هل ممكن تحويل الخط الى مجسم دائري بسمك معين ؟

MTASA1.png

MTASA2.png

الكود الحالي

local img = dxCreateTexture("test.png") 
dxSetTextureEdge(img,"mirror") 
addEventHandler("onClientRender", root, 
    function() 
    x, y, z = getElementPosition(localPlayer) 
        dxDrawMaterialLine3D (x,y,z,0,0,15,img, 0.5) 
    end) 

Link to comment

جرب هذا الكود

local img = dxCreateTexture("test.png"); 
dxSetTextureEdge(img,"mirror"); 
addEventHandler("onClientRender", root, 
function() 
    x, y, z = getElementPosition(localPlayer) 
    radius = 3; 
    for i = 1, 30 do 
        x = x + math.cos(math.rad((360/30)*i))*radius; 
        y = y + math.sin(math.rad((360/30)*i))*radius; 
        xr = x + math.cos(math.rad((360/30)*(i+7)))*radius; 
        yr = y + math.sin(math.rad((360/30)*(i+7)))*radius; 
        dxDrawMaterialLine3D(x, y, z, xr, yr, z+5, img, 0.5) 
    end 
end ); 

الكود الأصلي من صنع (50p)

function dxDrawCircle3D( x, y, z, radius, segments, color, width ) 
    color = color or tocolor( 255, 255, 0 ); 
    width = width or 2; 
    local segAngle = 360 / 30; 
    local fX, fY, tX, tY; 
    for i = 1, segments 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; 
        dxDrawLine3D( fX, fY, z+5, tX, tY, z+5, color, width ); 
    end 
end 

Link to comment
جرب هذا الكود

local img = dxCreateTexture("test.png"); 
dxSetTextureEdge(img,"mirror"); 
addEventHandler("onClientRender", root, 
function() 
    x, y, z = getElementPosition(localPlayer) 
    radius = 3; 
    for i = 1, 30 do 
        x = x + math.cos(math.rad((360/30)*i))*radius; 
        y = y + math.sin(math.rad((360/30)*i))*radius; 
        xr = x + math.cos(math.rad((360/30)*(i+7)))*radius; 
        yr = y + math.sin(math.rad((360/30)*(i+7)))*radius; 
        dxDrawMaterialLine3D(x, y, z, xr, yr, z+5, img, 0.5) 
    end 
end ); 

الكود الأصلي من صنع (50p)

function dxDrawCircle3D( x, y, z, radius, segments, color, width ) 
    color = color or tocolor( 255, 255, 0 ); 
    width = width or 2; 
    local segAngle = 360 / 30; 
    local fX, fY, tX, tY; 
    for i = 1, segments 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; 
        dxDrawLine3D( fX, fY, z+5, tX, tY, z+5, color, width ); 
    end 
end 

mta_screen_2016_03_19_14_31_52.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...