setcomp VEX function

Sets a single component of a vector type, matrix type, or array.

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

See also: getcomp

  1. void setcomp(vector &target, float value, int index)

  2. void setcomp(vector4 &target, float value, int index)

  3. void setcomp(matrix &target, float value, int row, int col)

  4. void setcomp(matrix3 &target, float value, int row, int col)

  5. type setcomp(arraytype array; type value, int index)


You can also use name[index] = value notation to set the value at index for vectors and arrays. See arrays.