Difference between revisions of "bezierInterpolation"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_x" to "_x")
m (Text replacement - "_this" to "_this")
Line 57: Line 57:
 
<dt class="note">[[User:User Name|User Name]]</dt>
 
<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.
 
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
+
<code>[[if]] ([[Magic Variables#this|_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
 
-->
 
-->
 
<!-- END Note Section -->
 
<!-- END Note Section -->

Revision as of 14:22, 25 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Math

Syntax

Syntax:
Syntax needed
Parameters:
progress: Number - interpolation value
[pos0, pos1,... posN]: Array
pos: Array in format Position3D
Return Value:
Return value needed

Examples

Example 1:
Quick demonstration that spawns some spheres around player object:for "_i" from 0 to 1 step 0.05 do { createVehicle ["Sign_Sphere10cm_F",(_i bezierInterpolation [ player modelToWorld [0,0,0], player modelToWorld [0,2,2], player modelToWorld [2,0,2], player modelToWorld [0,0,4] ]),[],0,"CAN_COLLIDE"]; };
Example 2:
Create a map marker curve from 4 control points with overlap (progress is -0.5...1.5 instead of 0...1):private _controlPoints = [[100,-90],[200,-30],[150,60],[100,90]] apply { player getRelPos _x }; { private _marker = createMarkerLocal [str _x, _x]; _marker setMarkerTypeLocal "mil_objective"; _marker setMarkerTextLocal ("P" + str _forEachIndex); } forEach _controlPoints; for "_i" from -0.5 to 1.5 step 0.01 do { private _marker = createMarkerLocal [str _i, _i bezierInterpolation _controlPoints]; _marker setMarkerTypeLocal "mil_dot"; }; openMap true;

Additional Information

See also:
linearConversionvectorLinearConversion

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