drawLine3D: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Color" to "Color (RGBA)")
m (Eff Local)
 
(47 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 0.50


|0.50|Game version=
|gr1= Interaction


|gr1= Interaction |GROUP1=
|eff= local
____________________________________________________________________________________________


| Draws a line of a given color between two 3D positions. Command has to be executed each frame. Use [[onEachFrame]] or [[addMissionEventHandler]] "Draw3D". |DESCRIPTION=
|descr= Draws a line of a given colour between two 3D positions in the current frame. To be used mostly in a [[Arma 3: Mission Event Handlers#Draw3D|"Draw3D"]] [[addMissionEventHandler|mission event handler]].
____________________________________________________________________________________________


| '''drawLine3D''' [start, end, color] |SYNTAX=
|s1= [[drawLine3D]] [start, end, color]


|p1= [start, end, color]: [[Array]] |PARAMETER1=
|p1= start: [[Array]] format [[Position#PositionAGL|PositionAGL]]


|p2= start: [[PositionAGL]] |PARAMETER2=
|p2= end: [[Array]] format [[Position#PositionAGL|PositionAGL]]


|p3= end: [[PositionAGL]] |PARAMETER3=
|p3= color: [[Array]] format [[Color|Color (RGBA)]]


|p4= color: [[Color|Color (RGBA)]] |PARAMETER4=
|r1= [[Nothing]]


| [[Nothing]] |RETURNVALUE=
|x1= <sqf>onEachFrame {
drawLine3D [getPos player, getPos cursorTarget, [1,1,1,1]];
};</sqf>


|seealso= [[drawIcon3D]] [[ASLToAGL]]
}}


|x1= <code>[[onEachFrame]] {
{{Note
[[drawLine3D]] [<nowiki/>[[getPos]] [[player]], [[getPos]] [[cursorTarget]], [1,1,1,1]];
|user= Killzone_Kid
};</code>|EXAMPLE1=
|timestamp= 20130831092700
____________________________________________________________________________________________
|text= As the command syntax indicates, this command expects starting and ending position in format [[Position#PositionAGL|PositionAGL]] meaning that over the land it expects [[Position#PositionATL|PositionATL]] and over the sea [[Position#PositionASLW|PositionASLW]]. Use additional [[ASLToAGL]] and [[AGLToASL]] commands wherever is necessary.


| [[drawIcon3D]] |SEEALSO=
<sqf>addMissionEventHandler ["Draw3D", {
drawLine3D [ASLToAGL eyePos soldier1, ASLToAGL eyePos soldier2, [1,0,0,1]];
}];</sqf>
}}


| |MPBEHAVIOUR=  
{{Note
____________________________________________________________________________________________
|user= Waffle SS.
|timestamp= 20150218021000
|text= Visible through fog and past draw distance.
}}
}}


<h3 style='display:none'>Notes</h3>
{{Note
<dl class='command_description'>
|user= fusselwurm
<!-- Note Section BEGIN -->
|timestamp= 20211125213710
<dd class="notedate">Posted on August 31, 2013
|text= Caveat: lines invisible through MH-9 helicopter windows, see https://feedback.bistudio.com/T66225
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]
}}
<dd class="note">As command syntax indicates, this command expects starting and ending position in format [[PositionAGL]] meaning that over the land it expects [[PositionATL]] and over the sea [[PositionASLW]]. Use additional [[ASLToAGL]] and [[AGLToASL]] commands wherever is necessary.
 
<code>[[addMissionEventHandler]] ["Draw3D", {
[[drawLine3D]] [<nowiki/>[[ASLToAGL]] [[eyePos]] soldier1, [[ASLToAGL]] [[eyePos]] soldier2, [1,0,0,1]];
}];</code>
 
 
<!-- Note Section END -->
</dl>
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on February 18, 2015 - 02:10 (UTC)</dd>
<dt class="note">[[User:Waffle SS.|Waffle SS.]]</dt>
<dd class="note">
Visible through fog and past draw distance.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 10:45, 16 September 2023

Hover & click on the images for description

Description

Description:
Draws a line of a given colour between two 3D positions in the current frame. To be used mostly in a "Draw3D" mission event handler.
Groups:
Interaction

Syntax

Syntax:
drawLine3D [start, end, color]
Parameters:
start: Array format PositionAGL
end: Array format PositionAGL
color: Array format Color (RGBA)
Return Value:
Nothing

Examples

Example 1:
onEachFrame { drawLine3D [getPos player, getPos cursorTarget, [1,1,1,1]]; };

Additional Information

See also:
drawIcon3D ASLToAGL

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Killzone_Kid - c
Posted on Aug 31, 2013 - 09:27 (UTC)
As the command syntax indicates, this command expects starting and ending position in format PositionAGL meaning that over the land it expects PositionATL and over the sea PositionASLW. Use additional ASLToAGL and AGLToASL commands wherever is necessary.
addMissionEventHandler ["Draw3D", { drawLine3D [ASLToAGL eyePos soldier1, ASLToAGL eyePos soldier2, [1,0,0,1]]; }];
Waffle SS. - c
Posted on Feb 18, 2015 - 02:10 (UTC)
Visible through fog and past draw distance.
fusselwurm - c
Posted on Nov 25, 2021 - 21:37 (UTC)
Caveat: lines invisible through MH-9 helicopter windows, see https://feedback.bistudio.com/T66225