HazJ 1289 Posted July 2, 2018 Hello, Basically what I would like to do is draw an outline around a player through walls. To give you an easy clear understanding look at the following screenshot. I am looking to achieve something like this or hopefully close. The only way I can see doing this is using drawPolygon with draw EH however, how would I return all the points of the player? Would I need to get all points manually, from the center of the base model? https://community.bistudio.com/wiki/drawPolygon Share this post Link to post Share on other sites
Greenfist 1863 Posted July 2, 2018 drawPolygon only draws on maps so that won't help, unless you create a transparent map display on the screen and somehow convert the 3D positions to the map. You could find the named selections on the unit with selectionPosition and then create lines between them with drawline3D. But that would produce only a stick figure. For an accurate outline, I can't think of anything else other than casting an array of lineintersects from camera towards the selectionpositions and trying to find the edges of the character. But that would be ridiculously intensive and difficult. 1 Share this post Link to post Share on other sites
7erra 629 Posted July 2, 2018 Well here is a very basic option: _3DMEH = addMissionEventHandler ["Draw3D",{ _unitArray = [testMan]; { _curObject = _x; { _curSelectionName = _x; _posIcon = _curObject modelToWorld (_curObject selectionPosition _curSelectionName); if !((_curObject selectionPosition _curSelectionName) isEqualTo [0,0,0]) then { drawIcon3D ["\A3\ui_f\data\map\markers\military\box_CA.paa",[1,0,0,1],_posIcon,0.5,0.5,0,""]; }; } forEach (selectionNames _x); } forEach _unitArray; }]; It simply marks each selection point of the unit with a red square. Even though it uses the MEH it still lags out but as I already said it is a very basic function. The next step could be to draw lines between the selction points. 1 Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted July 3, 2018 14 hours ago, 7erra said: Well here is a very basic option: _3DMEH = addMissionEventHandler ["Draw3D",{ _unitArray = [testMan]; { _curObject = _x; { _curSelectionName = _x; _posIcon = _curObject modelToWorld (_curObject selectionPosition _curSelectionName); if !((_curObject selectionPosition _curSelectionName) isEqualTo [0,0,0]) then { drawIcon3D ["\A3\ui_f\data\map\markers\military\box_CA.paa",[1,0,0,1],_posIcon,0.5,0.5,0,""]; }; } forEach (selectionNames _x); } forEach _unitArray; }]; It simply marks each selection point of the unit with a red square. Even though it uses the MEH it still lags out but as I already said it is a very basic function. The next step could be to draw lines between the selction points. Well it doesn't lag out, it's just how modelToWorld works. Using modelToWorldVisual provides a more fluid experience. _3DMEH = addMissionEventHandler ["Draw3D",{ _unitArray = allUnits; { _curObject = _x; { _curSelectionName = _x; _posIcon = _curObject modelToWorldVisual (_curObject selectionPosition _curSelectionName); if !((_curObject selectionPosition _curSelectionName) isEqualTo [0,0,0]) then { drawIcon3D ["\A3\ui_f\data\map\markers\military\box_CA.paa",[1,0,0,1],_posIcon,0.5,0.5,0,""]; }; } forEach (selectionNames _x); } forEach _unitArray; }]; The entire snippet is still pretty darn expensive, on my rig 1.17ms for 2 units, the drawIcon3D command being the least expensive bit. Cheers 3 Share this post Link to post Share on other sites