vectorLinearConversion: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {{uc:{{PAGENAME}}}}" to "")
m (Text replacement - "\|( *\[\[[a-zA-Z]+\]\]) - ([a-z -]+) \|x1=" to "|r1=$1 - $2 |x1=")
Line 25: Line 25:
|p7=clip (Optional): [[Boolean]] - if [[true]], range value will be clipped to stay within "from" - "to" range. Default: [[false]]
|p7=clip (Optional): [[Boolean]] - if [[true]], range value will be clipped to stay within "from" - "to" range. Default: [[false]]


| [[Array]] - interpolated vector
|r1= [[Array]] - interpolated vector


|x1= <code>[[vectorLinearConversion]] [0,1,0.5,[0,0,0],[25,50,100],[[false]]]; // [12.5,25,50]</code>
|x1= <code>[[vectorLinearConversion]] [0,1,0.5,[0,0,0],[25,50,100],[[false]]]; // [12.5,25,50]</code>

Revision as of 15:34, 10 June 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Math - Vectors

Syntax

Syntax:
Syntax needed
Parameters:
[rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]: Array
rangeFrom: Number - start "from" range
rangeTo: Number - end "to" range
rangeValue: Number - variable range value
vectorFrom: Array - start "from" vector
vectorTo: Array - end "to" vector
clip (Optional): Boolean - if true, range value will be clipped to stay within "from" - "to" range. Default: false
Return Value:
Array - interpolated vector

Examples

Example 1:
vectorLinearConversion [0,1,0.5,[0,0,0],[25,50,100],false]; // [12.5,25,50]
Example 2:
vectorLinearConversion [0,1,100,[0,0,0],[25,50,100],true]; // [25,50,100]
Example 3:
vectorLinearConversion [0,1,100,[0,0,0],[25,50,100],false]; // [2500,5000,10000]

Additional Information

See also:
linearConversionbezierInterpolationmatrixMultiplymatrixTranspose

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