screenToWorldDirection

From Bohemia Interactive Community
Revision as of 22:10, 5 June 2024 by Leopard20 (talk | contribs) (Created page with "{{RV|type=command |game1= arma3 |version1= 2.18 |gr1= Positions |descr= Returns the 3D vector in world corresponding to the given point on the screen (in UI coordinates), as if the vector was aiming from the camera to the screen position. |s1= screenToWorldVector screen |p1= screen: Array - screen position [x,y] (see SafeZone for more info) |r1= Array - Vector3D world vector |s2= camera screenToWorldVector position |p21= camera: [[Object]...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Returns the 3D vector in world corresponding to the given point on the screen (in UI coordinates), as if the vector was aiming from the camera to the screen position.
Groups:
Positions

Syntax

Syntax:
screenToWorldVector screen
Parameters:
screen: Array - screen position [x,y] (see SafeZone for more info)
Return Value:
Array - Vector3D world vector

Alternative Syntax

Syntax:
camera screenToWorldVector position
Parameters:
camera: Object - camera object
position: Array - screen position [x,y] (see SafeZone for more info)
Return Value:
Array - Vector3D world vector

Examples

Example 1:
_vec = screenToWorldVector [0.5, 0.5]; // a vector pointing to the front of the camera

Additional Information

See also:
SafeZone worldToScreen screenToWorld

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