MysticEmpire Posted June 26, 2017 Share Posted June 26, 2017 Anyone help me ? My code; local minX = 2 tex = dxCreateTexture("texture.png") function test3DGUI() minX = getElementBoundingBox(localPlayer) x,y,z,lx,ly,lz,x2,y2,z2 = getPositionFromElementOffset(minX-1,0,minX+0.5,1) dxDrawMaterialLine3D(x2,y2,z2+0.5,x,y,z+0.5, tex, 1, tocolor(0,0,0,150),lx,ly,lz) dxDrawMaterialLine3D(x2,y2,z2+0.5,x,y,z2+0.32, tex, 1, tocolor(255,0,29,255),lx,ly,lz) local sx,sy = getScreenFromWorldPosition ( x2,y2,z2, 0 ) dxDrawText ( "3D text", sx, sy - 30, sx, sy - 30, tocolor(255,255,255,255), 1, "bankgothic", "center", "bottom", false, false, false ) end addEventHandler("onClientRender", root, test3DGUI) function getPositionFromElementOffset(offX,offY,offX2,offY2) local offZ = -0.5 local m = getElementMatrix ( localPlayer ) local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] local x2 = offX2 * m[1][1] + offY2 * m[2][1] + offZ * m[3][1] + m[4][1] local y2 = offX2 * m[1][2] + offY2 * m[2][2] + offZ * m[3][2] + m[4][2] local z2 = offX2 * m[1][3] + offY2 * m[2][3] + offZ * m[3][3] + m[4][3] offZ = 0.5 local x3 = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] local y3 = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z3 = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z, x2, y2, z2, x3, y3, z3 end Link to comment
pa3ck Posted June 26, 2017 Share Posted June 26, 2017 Look at this post and edit/add the needed details accordingly In short, tell us what's not working, any debug errors and steps you tried to solve your problem so far. 1 Link to comment
Moderators IIYAMA Posted June 27, 2017 Moderators Share Posted June 27, 2017 11 hours ago, MysticEmpire said: Up Your order: spaghetti with marinara sauce + egg noodles and ketchup is not ready yet, I am terrible sorry. I have no clue what you want. Link to comment
Moderators IIYAMA Posted June 27, 2017 Moderators Share Posted June 27, 2017 Render both as 2D. Then capture them with a render target. https://wiki.multitheftauto.com/wiki/DxCreateRenderTarget And as last render the rendertarget(image/texture format) in 3D. Link to comment
MysticEmpire Posted June 27, 2017 Author Share Posted June 27, 2017 can you please give me example or fix my code ? Link to comment
Moderators IIYAMA Posted June 27, 2017 Moderators Share Posted June 27, 2017 There is already an example on wiki, which only require copy past. 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