Jump to content

help dxdrawimage3d


WASSIm.

Recommended Posts

i guys. this script for test dxDrawImage3D and i test it now. but i have problem to rotation :(

--Rectangle3D 
local dot = dxCreateTexture(1,1) 
local white = tocolor(255,255,255,255) 
function dxDrawRectangle3D(x,y,z,w,h,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, dot, h, c or white, ...) 
end 
---Image3D 
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 
  
--test 
local face = dxCreateTexture("test.png") 
addEventHandler("onClientRender", root, 
    function() 
        local xc, yc, zc, lxc, lyc, lzc = getCameraMatrix( ) 
        dxDrawImage3D(2410,-1733, 14, 20, 20, face, tocolor(255,255,255,255)) 
    end 
) 

Link to comment

That is the problem with dxDrawImage3D function itself. Whoever made this, simply adds width and height to to the x and y coords as well as "rotation" to z coord, which seem wrong. You can try to mess with the last param (after tocolor in your script @ line 20), which apparently is "rotation", if that fails you need to calculate the rotation yourself. I've tried to make particles system by drawing a 3D image but because of the complexity I dropped the project.

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