This information is for Vicon Shogun 1.7. For up-to-date help, see the latest Shogun documentation.

Vicon Shogun banner


Returns a scaled vector of length len, collinear with vec. Does not modify vec.

Use setLength when you need to set the length of a given vector. For example, you might want to change the length of a given bone, which can be thought of as vector from one bone joint to another.

The length of the vector is the square root of the sum of the squares of each vector component.

Useful for setting the lengths of the bones in a skeleton based on performer dimensions.

Note that the input vector vector is not modified.

Functional area


Command syntax


setLength vector length


vectorvectoryesVector that points in the desired direction
lengthfloatyesFloat value of vector length or magnitude



Return value


Returns a variable of type vector which points in the same direction as vec, but is of length len.


// Declare a vector, then changes its length
// The command will return a vector value of: <>
vector $v1 = <<1, 1, 0>>, $v1 = `setLength $v1 1.0`;
print( $v1 );

Additional information

Related commands