Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:1.31

Description

Description:Takes azimuth and elevation as parameters, and returns a unit vector that points in the resulting direction.

Here are some typical angles, and their associated vectors:

  • 0: [0,1,0]
  • 45: [0.71,0.71,0]
  • 90: [1,0,0]
  • 135: [0.71,-0.71,0]
  • 180: [0,-1,0]
  • 225: [-0.71,-0.71,0]
  • 270: [-1,0,0]
  • 315: [-0.71,0.71,0]
  • 360: [0,1,0]

Syntax

Syntax:[azimuth, elevation] call fn_vbs_dirToVector
Parameters:
  • azimuth: Number - Compass direction.
  • elevation: Number - Degrees above the horizontal (optional, default: 0).
Return Value:Vector3D

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
[0, 0] call fn_vbs_dirToVector
// Result is [0,1,0]

[90, 0] call fn_vbs_dirToVector
// Result is [1,0,0]

[0, 90] call fn_vbs_dirToVector
// Result is [0,0,1]

Additional Information

See also: dirToVector, fn vbs vectorToDir, fn vbs vectorAngle
Multiplayer: 
Problems: 

Notes