screenToWorldDirection: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "↵|version1= 2.18↵↵|branch= dev↵" to " |version1= 2.18 ") Tag: Manual revert |
BrettMayson (talk | contribs) mNo edit summary |
||
| Line 12: | Line 12: | ||
|p1= screen: [[Array]] - screen position [x,y] (see [[SafeZone]] for more info) | |p1= screen: [[Array]] - screen position [x,y] (see [[SafeZone]] for more info) | ||
|r1= [[ | |r1= [[Vector3D]] - world vector | ||
|s2= camera [[screenToWorldDirection]] position | |s2= camera [[screenToWorldDirection]] position | ||
| Line 20: | Line 20: | ||
|p22= position: [[Array]] - screen position [x,y] (see [[SafeZone]] for more info) | |p22= position: [[Array]] - screen position [x,y] (see [[SafeZone]] for more info) | ||
|r2= [[ | |r2= [[Vector3D]] - world vector | ||
|x1= <sqf>private _vec = screenToWorldDirection [0.5, 0.5]; // a vector pointing to the front of the camera</sqf> | |x1= <sqf>private _vec = screenToWorldDirection [0.5, 0.5]; // a vector pointing to the front of the camera</sqf> | ||
Latest revision as of 18:05, 3 April 2026
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:
- screenToWorldDirection screen
- Parameters:
- screen: Array - screen position [x,y] (see SafeZone for more info)
- Return Value:
- Vector3D - world vector
Alternative Syntax
- Syntax:
- camera screenToWorldDirection position
- Parameters:
- camera: Object - camera object
- position: Array - screen position [x,y] (see SafeZone for more info)
- Return Value:
- Vector3D - world vector
Examples
- Example 1:
Additional Information
- See also:
- SafeZone worldToScreen screenToWorld
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note