getcomp VEX function

Extracts 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: setcomp

  1. float getcomp(vector v; int index)

  2. float getcomp(vector4 v; int index)

  3. float getcomp(matrix m; int row, int column)

  4. float getcomp(matrix3 m; int row, int column)

  5. type getcomp(arraytype array; int index)


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