lolcatsareawesome Posted July 14, 2013 Share Posted July 14, 2013 Hi all, I want to know how the guy make his icons in DX i mean, what kind of calculs did he make for that? How he put theses animations ? Tnx Link to comment
Moderators IIYAMA Posted July 14, 2013 Moderators Share Posted July 14, 2013 This maybe? Animation probably created by increasing the material line and changing the offZet. local PosX= ... local PosY= ... local PosZ= ... local offZetX1 = PosX+10 local offZetY1 = PosY+10 local offZetX2 = PosX-10 local offZetY2 = PosY-10 dxDrawMaterialLine3D ( offZetX1, offZetY1, PosZ, offZetX2,offZetY2, PosZ,material, 10) Link to comment
lolcatsareawesome Posted July 14, 2013 Author Share Posted July 14, 2013 Okay, so I used dxDrawMaterialLine3D but I've a problem. We can't do rotation on the element? I mean, in the video, the thing is on the floor like rotation in 90°. In my script, it's in 0. Possible? My code: function ckl ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button == "left" and state == "down" then local img = dxCreateTexture("img.png") addEventHandler("onClientPreRender", getRootElement(), function() dxDrawMaterialLine3D ( worldX, worldY, worldZ,worldX, worldY, worldZ+10, img, 10, tocolor(255, 255, 255, 255), 0, 0, 0) end) end end addEventHandler ( "onClientClick", getRootElement(), ckl ) Link to comment
iMr.3a[Z]eF Posted July 14, 2013 Share Posted July 14, 2013 https://community.multitheftauto.com/index.php?p= ... ls&id=5832 Link to comment
Moderators IIYAMA Posted July 14, 2013 Moderators Share Posted July 14, 2013 It can, by changing the coordinates of the start and end. You have the middle point, you create offset from there. And you let the offset locations move around the middle point. I hope you have learned to work with tables, because these are the one you need to manage for more then one icon. At the moment your code is creating for every click a new event, that will start lagging and next to that it isn't manage able cause you can't stop it without turning off the script. @ 6ArHxiMr'3a[Z]eF Use what you have, to reason to create hundred of images for just one effect.All you need is math to do the job. Link to comment
lolcatsareawesome Posted July 14, 2013 Author Share Posted July 14, 2013 It can, by changing the coordinates of the start and end.You have the middle point, you create offset from there. And you let the offset locations move around the middle point. I hope you have learned to work with tables, because these are the one you need to manage for more then one icon. At the moment your code is creating for every click a new event, that will start lagging and next to that it isn't manage able cause you can't stop it without turning off the script. @ 6ArHxiMr'3a[Z]eF Use what you have, to reason to create hundred of images for just one effect.All you need is math to do the job. Well, I try to edit the coordinates but I can't find for this rotation. code: Elements = {} img = dxCreateTexture("img.png") addEventHandler("onClientRender", getRootElement(), function() for i, k in ipairs(Elements)do dxDrawMaterialLine3D ( k.x, k.y, k.z, k.lx, k.ly, k.lz, img, 10, tocolor(255, 255, 255, 255), 0, 0, 0) end end) function ckl ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button == "left" and state == "down" then local temp = {} temp.x = worldX; temp.y = worldY; temp.z = worldZ; temp.lx = worldX; temp.ly = worldY; temp.lz = worldZ; table.insert(Elements, temp) end end addEventHandler ( "onClientClick", getRootElement(), ckl ) Look: temp.x = worldX; temp.y = worldY; temp.z = worldZ; temp.lx = worldX+10; temp.ly = worldY; temp.lz = worldZ; temp.x = worldX; temp.y = worldY; temp.z = worldZ; temp.lx = worldX; temp.ly = worldY+10; temp.lz = worldZ; temp.x = worldX; temp.y = worldY; temp.z = worldZ; temp.lx = worldX; temp.ly = worldY; temp.lz = worldZ+10; I really don't undestand how this works. Link to comment
Moderators IIYAMA Posted July 14, 2013 Moderators Share Posted July 14, 2013 I only know the math for flat rotations. (like on the movie) Must it really be this? Link to comment
Alexs Posted July 14, 2013 Share Posted July 14, 2013 local material = dxCreateTexture( "Medic.png" ) local x, y, z = 0, 0, 0 addEventHandler( "onClientRender", root, function() dxDrawMaterialLine3D( x, y, z, x, y + 5, z +.05, material, 5, tocolor( 255,255,255,255 ), x, y, z + 1) end ) addCommandHandler( "aca", function( ) x, y, sz = getElementPosition( localPlayer ) z = getGroundPosition( x, y, sz ) end ) faceTowardX/Y/Z: The direction the front of the line should face towards. If this is not set, the front of the line always faces toward the camera. Link to comment
50p Posted July 14, 2013 Share Posted July 14, 2013 dxDrawMaterialLine3D has facing direction parameters (last 3 params) which you can use to make the rotation. Your example shows the facing coords is the middle of the San Andreas (0.0, 0.0, 0.0). If you want it to face up, then use the same coords of the placement with exception of Z being higher. float faceTowardX, float faceTowardY, float faceTowardZ Example: dxDrawMaterialLine3D ( k.x, k.y, k.z, k.lx, k.ly, k.lz, img, 10, tocolor(255, 255, 255, 255), k.x, k.y, k.z+1) As you can see, I used the same coords for facing as the "start" coords but I added +1 to Z, which will make the material face UP the Z axis. Link to comment
lolcatsareawesome Posted July 14, 2013 Author Share Posted July 14, 2013 Thanks alot for your help Link to comment
MegaThorx Posted August 3, 2013 Share Posted August 3, 2013 Iv'e uploaded my pointer resource https://community.multitheftauto.com/index.php?p= ... ls&id=7687 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