fromBufferAttribute method

Color fromBufferAttribute(
  1. BufferAttribute<NativeArray<num>> attribute,
  2. int index
)

Implementation

Color fromBufferAttribute(BufferAttribute attribute, int index) {
  r = attribute.getX(index)!.toDouble();
  g = attribute.getY(index)!.toDouble();
  b = attribute.getZ(index)!.toDouble();

  if (attribute.normalized == true) {
    // assuming Uint8Array

    r /= 255;
    g /= 255;
    b /= 255;
  }

  return this;
}