HazJ 1289 Posted February 24, 2018 Hi, I am using the below code to draw an icon on a door. It works fine but there is a weird offset issue. Is there a fix for this or just a manual offset work-around? Maybe I could get position between Door_2_trigger and Door_2? See pictures below. // for quick testing drawIcon3D [MISSION_ROOT + "client\visual\unlocked.paa", [1, 1, 1, 1], [((warehouse modelToWorld (warehouse selectionPosition "Door_2_trigger")) select 0), ((warehouse modelToWorld (warehouse selectionPosition "Door_2_trigger")) select 1), ((warehouse modelToWorld (warehouse selectionPosition "Door_2_trigger")) select 2)], 1, 1, 0, "", 1, 0, "PuristaMedium"]; Door_2 Door_2_trigger 1 Share this post Link to post Share on other sites
Tankbuster 1744 Posted February 24, 2018 I get the same, Harry. It's not just you. I gave up and got a position by hand. 1 Share this post Link to post Share on other sites
HazJ 1289 Posted February 24, 2018 ArmA'd. Everytime. 1 Share this post Link to post Share on other sites
Tankbuster 1744 Posted February 24, 2018 Yep. 'Fraid so. Share this post Link to post Share on other sites
Larrow 2820 Posted February 24, 2018 @HazJ What exactly are you trying to get there? 5 hours ago, HazJ said: Maybe I could get position between Door_2_trigger and Door_2? The middle of the small door? If so then that is door 7, door 2 is the large righthand door. "Door_7_trigger" will give you roughly the middle of the letterbox on the small door. 2 Share this post Link to post Share on other sites
HazJ 1289 Posted February 24, 2018 DAMN! Thank you @Larrow once again! Larrow'd... This works perfectly but when I open the door, the icon stays in the middle, is there a way to properly attach it so when the door opens, the icon moves with it? Share this post Link to post Share on other sites
HazJ 1289 Posted February 25, 2018 Still looking for a way to properly attach it so it stays on door regardless of animation phase (open/closed). Share this post Link to post Share on other sites
Larrow 2820 Posted February 26, 2018 Maybe this will give you some idea to go by, just quickly thrown together so not spot on (vector math makes my brain hurt)... removeAllMissionEventHandlers "Draw3D"; addMissionEventHandler [ "Draw3D", { _door7Pos = warehouse selectionPosition "Door_7"; _door7AxisPos = warehouse selectionPosition "Door_7_axis"; _door7AxisPos set[ 2, _door7Pos select 2 ]; _vectorDir7 = vectorNormalized( _door7Pos vectorDiff _door7AxisPos ); _door7CenterPos = warehouse selectionPosition "Door_7_trigger"; _door7AxisPos set[ 2, _door7CenterPos select 2 ]; _door7CenterOffest = _door7AxisPos vectorDiff _door7CenterPos; _position = ( _door7AxisPos vectorAdd ( _vectorDir7 vectorMultiply ( _door7CenterOffest select 1 ))); { private [ "_pos" ]; _x params[ "_selection", "_color" ]; _name = if ( _selection isEqualType "" ) then { _pos = warehouse selectionPosition _selection; _selection }else{ _pos = _selection; "" }; drawIcon3D [ "\a3\modules_f\data\iconunlock_ca.paa", _color, warehouse modelToWorldVisual _pos, 1, 1, 1, _name, 0, 0.05, "PuristaMedium" ]; }forEach [ [ _position, [ 1, 1, 1, 1 ] ], [ "Door_7", [ 1, 0, 0, 1 ] ], [ "Door_7_trigger", [ 0, 1, 0, 1 ] ], [ "Door_7_axis", [ 0, 0, 1, 1 ] ], [ "Door_2", [ 1, 0, 0, 1 ] ], [ "Door_2_trigger", [ 0, 1, 0, 1 ] ], [ "Door_2_axis", [ 0, 0, 1, 1 ] ] ]; }]; Then you just need to work out the door7 axis position for when door2 is opened so as the icon remains in the right place when the large door is opened. Could of picked an easier door to work with 4 Share this post Link to post Share on other sites
HazJ 1289 Posted February 26, 2018 Thank you @Larrow! I will mess with that a bit later. I sent you a beer by the way! 1 Share this post Link to post Share on other sites