qevhytpl 发表于 2021-2-23 00:03:55

VBS上setVelocityTransformation的用法

最近想做个打印视频,setVelocityTransformation这个命令很有用,BI scripts 写的像一坨翔。
偶然发现VBS2网站,果然清爽了很多。

Description:       
Places an object at an interpolated position between two other objects, and sets its vectors in proportion to the relative position.
The final position / vector is determined by the interval specified in the command. This assumes an imaginary path between the two reference objects, where, at the beginning of the path (interval: 0), the position and vector are identical to the first reference object, at the end of the path (interval: 1), the position and vector are identical to the second reference object, and at 0.5 they are halfway in-between.

Syntax:        object setVelocityTransformation

Parameters:       
object: Object - Object to position.
pos1: PositionASL - ASL position of first reference object.
pos2: PositionASL - ASL position of second reference object.
vel1: Vector3D - velocity of first reference object.
vel2: Vector3D - velocity of second reference object.
dir1: Vector3D - vectorDir of first reference object.
dir2: Vector3D - vectorDir of second reference object.
up1: Vector3D - vectorUp of first reference object.
up2: Vector3D - vectorUp of second reference object.
interval: Number - Relative position between the two reference objects, where the manipulated object is placed at (0-1).

示例代码很清晰

Demo mission, placing 4 arrows between two helicopters, at 0.2 intervals: setVelocityTransformation.zip
// create some marker arrows
_markers = [];
for "_i" from 0 to 3 do {
_marker = "vbs2_visual_arrowside" createVehicle (player modelToWorld );
_markers = _markers + ;
};

// repeatedly place those 4 markers between two helicopters (a1 & a2)
while {true} do {
for "_i" from 0 to 3 do {
    _time = (_i+1)*.2; // arrows are at 0.2, 0.4, 0.6 & 0.8 intervals
    _arr = ;
    (_markers select _i) setVelocityTransformation _arr;
};
};

页: [1]
查看完整版本: VBS上setVelocityTransformation的用法