vecND

taichi_glsl.vector.vecND(n, *xs)

Create a n-D vector by scalars or vectors in arguments (GLSL-alike).

The return vector dimension depends on the specified argument n. If the dimension mismatch the count of scalars in xs, an error will be raised. However, if only one scalar is specified, then vecND(n, x) is equivalent to vecFill(n, x), see vecFill().

Parameters
  • n – Specify the dimension of return vector.

  • xs – Specify the scalar or vector values to initialize the vector components. If xs[i] is vector, it will be flatten into a series of scalars.

Returns

A n-D vector initialized as described above.

Note

vecND(n, x) -> vecFill(n, x) vecND(n, x, y, …) -> vec(x, y, …)

See also

vec(), vec2(), vec3().