Armanda551 2 Posted July 25, 2018 is it possible to create an movable control or drawing 2d on the screen (basically a line from me to the player infront of me (enemy or sth else doesnt matter)) Because i use drawline3d and this su*** sorry for that but the rendering is very bad. I could see a guy using lines 2d but doing it with 3d stuff as i said above drawing line from player to enemy nevermind this guy made it in arma 2 he said that he used an movable dialog but i want to do it in a control or with drawline but it seems to not work any ideas? Edit**: I found the video where he did this here Thanks, Armanda551 1 Share this post Link to post Share on other sites
Armanda551 2 Posted July 25, 2018 Or simpler how can i draw lines in 3d space with Drawline Not Drawline3d Share this post Link to post Share on other sites
HazJ 1288 Posted July 26, 2018 Hi, drawLine is for map, drawLine3D is for HUD. You can create your own, etc and use these: https://community.bistudio.com/wiki/worldToScreen https://community.bistudio.com/wiki/screenToWorld etc 1 Share this post Link to post Share on other sites
gokitty1199 225 Posted July 26, 2018 an example of drawLine3D, that command should do exactly what you want onEachFrame { { _distance = round (_x distance player); if (_distance < 801 && _x != player) then { _color = [0,0,0,1]; _side = side _x; switch (_side) do { case WEST: {_color = [0,0,1,1]}; case EAST: {_color = [1,0,0,1]}; case INDEPENDENT: {_color = [0,1,0,1]}; case CIVILIAN: {_color = [0.4,0,1,1]}; }; _distance = round (_x distance player); _posID = _x modelToWorldVisual [0,0,0]; _posBase = eyePos _x; _posTL1 = [(_posBase select 0) - 0.35, _posBase select 1, (_posBase select 2) - 4.9]; _posBL1 = [(_posBase select 0) - 0.35, _posBase select 1, (_posBase select 2) - 6.5]; _posTR1 = [(_posBase select 0) + 0.35, _posBase select 1, (_posBase select 2) - 4.9]; _posBR1 = [(_posBase select 0) + 0.35, _posBase select 1, (_posBase select 2) - 6.5]; _posTL2 = [_posBase select 0, (_posBase select 1) - 0.35, (_posBase select 2) - 4.9]; _posBL2 = [_posBase select 0, (_posBase select 1) - 0.35, (_posBase select 2) - 6.5]; _posTR2 = [_posBase select 0, (_posBase select 1) + 0.35, (_posBase select 2) - 4.9]; _posBR2 = [_posBase select 0, (_posBase select 1) + 0.35, (_posBase select 2) - 6.5]; if (_distance < 101) then { drawIcon3D ["", _color, _posID, 0, 00, 45, format ["%1: %2m", name _x, _distance], 0, 0.023]; } else {drawIcon3D ["", _color, _posID, 0, 00, 45, format ["*%1m",_distance], 0, 0.023]}; drawLine3D [_posTL1, _posTR1, _color]; drawLine3D [_posTL1, _posBL1, _color]; drawLine3D [_posTR1, _posBR1, _color]; drawLine3D [_posBL1, _posBR1, _color]; drawLine3D [_posTL2, _posTR2, _color]; drawLine3D [_posTL2, _posBL2, _color]; drawLine3D [_posTR2, _posBR2, _color]; drawLine3D [_posBL2, _posBR2, _color]; }; } forEach allUnits; }; 1 1 Share this post Link to post Share on other sites
Larrow 2801 Posted July 26, 2018 RscLine example. terminate h; h = [] spawn { _display = findDisplay 46; _ctrl = _display ctrlCreate [ "RscLine", 10001 ]; while { true } do { _bobPos = worldToScreen getPosATL bob; if !( _bobPos isEqualTo [] ) then { if ( ctrlFade _ctrl > 0 ) then { _ctrl ctrlSetFade 0; }; _ctrl ctrlSetPosition[ 0.5, 0.5, ( _bobPos select 0 ) - 0.5, ( _bobPos select 1 ) - 0.5 ]; }else{ //Bob is occluded work out screen space here to bob dir _ctrl ctrlSetFade 1; }; _ctrl ctrlCommit 0; }; }; Where bob is the Object you are tracking. I have left you to work out screen space for when the object is occluded as its just toooo hot to have Arma running and I'm just too lazy :D 2 Share this post Link to post Share on other sites
Armanda551 2 Posted July 27, 2018 Cool it worked, so i want to know how to draw it just on the player there shouldnt be a line to my middle of the screen Share this post Link to post Share on other sites
Armanda551 2 Posted July 27, 2018 btw im using @Larrow script thanks anyways Share this post Link to post Share on other sites
Armanda551 2 Posted July 27, 2018 EDIT-************** Forget this question above my bad How can i ctrlSetPosition the line between 2 points like in drawline3d. I have 2 model points with selectionPosition i want a line from point a to b Share this post Link to post Share on other sites