Jump to content

dxDrawImage3D


DRW

Recommended Posts

Hello, I have a problem, I want to make a big dximage that always looks at the player, and I tried this

local white = tocolor(255,255,255,255) 
function dxDrawImage3D(x,y,z,w,h,m,c,r,...) 
        local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z 
    return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c or white, ...) 
end 
  
local pnet = dxCreateTexture("planet.png") 
addEventHandler("onClientRender", root, 
    function() 
        dxDrawImage3D(0,0, 20, 20, 800, pnet, tocolor(255,255,255,255)) 
    end 
) 
  

Actually it works... If you look at the right side.

WpdiVDTl.jpg

If you look at the image from another position it looks like this.

m7Svfspl.jpg

I've seen some images like that working perfectly, without distortions and always looking at the player, so, how can I make it like that?

Link to comment

Try this

  
local white = tocolor(255,255,255,255) 
function dxDrawImage3D(x,y,z,w,h,m,c,r,...) 
        local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z 
    return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c or white, ...) 
end 
  
local pnet = dxCreateTexture("planet.png") 
addEventHandler("onClientRender", root, 
    function() 
    local x,y,z = getElementPosition(localPlayer) 
    dxDrawImage3D(0,0, 20, 20, 800, pnet, tocolor(255,255,255,255),0,x,y,z) 
    end 
) 

Link to comment
Try this
  
local white = tocolor(255,255,255,255) 
function dxDrawImage3D(x,y,z,w,h,m,c,r,...) 
        local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z 
    return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, m, h, c or white, ...) 
end 
  
local pnet = dxCreateTexture("planet.png") 
addEventHandler("onClientRender", root, 
    function() 
    local x,y,z = getElementPosition(localPlayer) 
    dxDrawImage3D(0,0, 20, 20, 800, pnet, tocolor(255,255,255,255),0,x,y,z) 
    end 
) 

Still the same

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...