Jump to content

[Question] dxDrawImage3D


kieran

Recommended Posts

I am wanting to create a 3D image, but I am struggling to even get the image in the game. xD 

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

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.

 

 

 

  • Thanks 1
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...