drawLine3D: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - ": PositionAGL" to ": Array format PositionAGL")
m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*) ([^ ]*) ([^ ]*)<\/code>" to "<code>$1$2$3 $4 $5</code>")
Line 18: Line 18:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>[[onEachFrame]] {
|x1= <code>onEachFrame {
[[drawLine3D]] [<nowiki/>[[getPos]] [[player]], [[getPos]] [[cursorTarget]], [1,1,1,1]];
[[drawLine3D]] [<nowiki/>[[getPos]] [[player]], [[getPos]] [[cursorTarget]], [1,1,1,1]];
};</code>
};</code>
Line 30: Line 30:
|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.  
|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.  


<code>[[addMissionEventHandler]] ["Draw3D", {
<code>addMissionEventHandler ["Draw3D", {
[[drawLine3D]] [<nowiki/>[[ASLToAGL]] [[eyePos]] soldier1, [[ASLToAGL]] [[eyePos]] soldier2, [1,0,0,1]];
[[drawLine3D]] [<nowiki/>[[ASLToAGL]] [[eyePos]] soldier1, [[ASLToAGL]] [[eyePos]] soldier2, [1,0,0,1]];
}];</code>
}];</code>

Revision as of 11:43, 12 May 2022

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