Difference between revisions of "bezierInterpolation"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Fix and example)
(filled up)
Line 13: Line 13:
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| Gets interpolated value based on bezier curve with given control points (progress is 0-1){{wip}} |Description=
+
| Gets interpolated value based on bezier curve with given control points (progress value is 0...1 for a curve that starts at pos0 and finishes at posN) |Description=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| progress [[bezierInterpolation]] <nowiki>[[x1, y1, z1], ... [xn, yn, zn]]</nowiki> |Syntax=
+
| progress [[bezierInterpolation]] <nowiki>[pos0, pos1,... posN]</nowiki> |Syntax=
  
|p1=progress: [[Number]]
+
|p1=progress: [[Number]] - interpolation value|PARAMETER1=
  
|p2=<nowiki>[[x1, y1, z1], ... [xn, yn, zn]]</nowiki>: [[Array]]
+
|p2=[pos0, pos1,... posN]: [[Array]]|PARAMETER2=
 +
|p3=pos: [[Array]] in format [[Position3D]]|PARAMETER3=
  
| [[Array]] |Return Value=
+
| [[Array]] - a single point position in format [[Position3D]] based on progress value |Return Value=
 
___________________________________________________________________________________________
 
___________________________________________________________________________________________
  
Line 37: Line 38:
 
|mp= - |Multiplayer Behaviour=
 
|mp= - |Multiplayer Behaviour=
  
| |See Also=
+
| [[linearConversion]], [[vectorLinearConversion]] |See Also=
 
}}
 
}}
  

Revision as of 17:08, 24 November 2019

Hover & click on the images for description

Description

Description:
Gets interpolated value based on bezier curve with given control points (progress value is 0...1 for a curve that starts at pos0 and finishes at posN)
Multiplayer:
-
Groups:
Uncategorised

Syntax

Syntax:
progress bezierInterpolation [pos0, pos1,... posN]
Parameters:
progress: Number - interpolation value
[pos0, pos1,... posN]: Array
pos: Array in format Position3D
Return Value:
Array - a single point position in format Position3D based on progress value

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"]; };

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

Bottom Section