Piorun Posted May 30, 2013 Share Posted May 30, 2013 Is this possible to create 3D hud? I tried with getScreenFromWorldPosition and dxDrawMaterialLine3D but it doesnt work. Any ideas? Link to comment
Piorun Posted May 30, 2013 Author Share Posted May 30, 2013 or another question - could anyway send me here an algoritm to create something (np. marker) on the left side of a player. I think this should be made with sinus, cosinus or something like that. Link to comment
Moderators IIYAMA Posted May 31, 2013 Moderators Share Posted May 31, 2013 most of the dx functions require the event's "onClientRender" or "onClientPreRender". 3D hud will be hard. But I don't think it will be impossible. 2: to the left side of the player or left side of the screen? There are some attachment functions, for attach things to other things. https://wiki.multitheftauto.com/wiki/AttachElements https://wiki.multitheftauto.com/wiki/Se ... hedOffsets Link to comment
Piorun Posted May 31, 2013 Author Share Posted May 31, 2013 To the left side of a Player. Anyway i dont want to attach element to Player but create something "near" Player. Something like i type "/create marker" and it create marker in the front of the player. Link to comment
Moderators IIYAMA Posted May 31, 2013 Moderators Share Posted May 31, 2013 local rx,ry,rz = getElementRotation (element) local pX,pY,pZ = getElementPosition (element) rz = (rz * 3.141592653 * 2)/360; local newX,newY,newZ = pX + math.cos(rz), pY + math.sin(rz), pZ Link to comment
Piorun Posted June 1, 2013 Author Share Posted June 1, 2013 rz = (rz * 3.141592653 * 2)/360; - are those radians, right? I think I forget about it. Thanks dude. Link to comment
50p Posted June 1, 2013 Share Posted June 1, 2013 Yes, you can use math.rad() instead: local newX,newY,newZ = pX + math.cos( math.rad( rz ) ), pY + math.sin( math.rad( rz ) ), pZ 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