vectorLinearConversion: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_this" to "_this")
mNo edit summary
 
(16 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma3
|game1= arma3
 
|version1= 1.92
|1.92
 
|arg=
 
|eff=


|gr2= Math - Vectors
|gr2= Math - Vectors


|serverExec=
|descr= Interpolates vector between the given ''vectorFrom'' and ''vectorTo'' value according to the given range value.


| Interpolates vector between the given "vectorFrom" and "vectorTo" value according to the given range value
|s1= [[vectorLinearConversion]] [rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]


| [[vectorLinearConversion]] [rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]
|p1= rangeFrom: [[Number]] - start "from" range


|p1=[rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]: [[Array]]
|p2= rangeTo: [[Number]] - end "to" range


|p2=rangeFrom: [[Number]] - start "from" range
|p3= rangeValue: [[Number]] - variable range value


|p3=rangeTo: [[Number]] - end "to" range
|p4= vectorFrom: [[Array]] - start "from" vector


|p4=rangeValue: [[Number]] - variable range value
|p5= vectorTo: [[Array]] - end "to" vector


|p5=vectorFrom: [[Array]] - start "from" vector
|p6= clip: [[Boolean]] - (Optional, default [[false]]) if [[true]], range value will be clipped to stay within "from" - "to" range


|p6=vectorTo: [[Array]] - end "to" vector
|r1= [[Array]] - interpolated vector


|p7=clip (Optional): [[Boolean]] - if [[true]], range value will be clipped to stay within "from" - "to" range. Default: [[false]]
|x1= <sqf>vectorLinearConversion [0, 1, 0.5, [0,0,0], [25,50,100], false]; // [12.5,25,50]</sqf>


| [[Array]] - interpolated vector
|x2= <sqf>vectorLinearConversion [0, 1, 100, [0,0,0], [25,50,100], true]; // [25,50,100]</sqf>


|x1= <code>[[vectorLinearConversion]] [0,1,0.5,[0,0,0],[25,50,100],[[false]]]; // [12.5,25,50]</code>
|x3= <sqf>vectorLinearConversion [0, 1, 100, [0,0,0], [25,50,100], false]; // [2500,5000,10000]</sqf>
|x2= <code>[[vectorLinearConversion]] [0,1,100,[0,0,0],[25,50,100],[[true]]]; // [25,50,100]</code>
|x3= <code>[[vectorLinearConversion]] [0,1,100,[0,0,0],[25,50,100],[[false]]]; // [2500,5000,10000]</code>


|seealso= [[linearConversion]], [[bezierInterpolation]], [[matrixMultiply]], [[matrixTranspose]]
|seealso= [[linearConversion]] [[bezierInterpolation]] [[matrixMultiply]] [[matrixTranspose]]
}}
}}
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- For example:
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
<dt class="note">[[User:User Name|User Name]]</dt>
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[Magic Variables#this|_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
-->
<!-- END Note Section -->
</dl>
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 21:21, 28 September 2023

Hover & click on the images for description

Description

Description:
Interpolates vector between the given vectorFrom and vectorTo value according to the given range value.
Groups:
Math - Vectors

Syntax

Syntax:
vectorLinearConversion [rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]
Parameters:
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: Boolean - (Optional, default false) if true, range value will be clipped to stay within "from" - "to" range
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:
linearConversion bezierInterpolation matrixMultiply matrixTranspose

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