kieran Posted November 27, 2017 Share Posted November 27, 2017 I am wanting to create a 3D image, but I am struggling to even get the image in the game. Here is the code, and error. Client side script local the_image = dxCreateTexture("image.png") addEventHandler("onClientRender", root, function() dxDrawImage3D(-2327, -1620, 483, 20, 20, the_image, tocolor(255,255,255,255)) end ) meta.xml <meta> <info author="kieran" type="script" name="3D_Images" /> <min_mta_version client="1.5.5" server="1.5.5" /> <script src="image.lua" type="client" /> <file src="image.png" /> </meta> Debug script 3: attempt to call global 'dxDrawImage3D' (a nil value) Any help would be appreciated, thanks. Link to comment
Dimos7 Posted November 27, 2017 Share Posted November 27, 2017 Did you use the code for that dxDrawImage3D because it a useful function Link to comment
kieran Posted November 27, 2017 Author Share Posted November 27, 2017 48 minutes ago, Dimos7 said: Did you use the code for that dxDrawImage3D because it a useful function What do you mean? I am using the code from wiki, but it keeps returning the same debug, so I think it has trouble loading the image, tried 2 images... Link to comment
Moderators IIYAMA Posted November 27, 2017 Moderators Share Posted November 27, 2017 https://wiki.multitheftauto.com/wiki/DxDrawImage3D Scroll down and add the code, from under the headline: code 1 Link to comment
kieran Posted November 27, 2017 Author Share Posted November 27, 2017 7 hours ago, IIYAMA said: https://wiki.multitheftauto.com/wiki/DxDrawImage3D Scroll down and add the code, from under the headline: code Creates the image, but my second xyz for face toward won't let me rotate the image.... What am I doing wrong? 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 the_image = dxCreateTexture("image.png") function create_image() dxDrawImage3D(-2329.5, -1610, 485, 5, 5, the_image, tocolor(255,255,255,255), 1, -2330, -1633, 483 ) end addEventHandler("onClientRender", root, create_image) Link to comment
Moderators IIYAMA Posted November 27, 2017 Moderators Share Posted November 27, 2017 I am not sure, I am not a fan of this custom function. Afaik dxDrawMaterialLine3D rotates between the points, but because the second point is moved, I am not sure which values you have to use. So I recommend you to use dxDrawMaterialLine3D instead. 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now