VertexTangentsHelper constructor

VertexTangentsHelper(
  1. dynamic object, [
  2. dynamic size = 1,
  3. dynamic color = 0x00ffff
])

Implementation

factory VertexTangentsHelper(object, [size = 1, color = 0x00ffff]) {
  var nTangents = object.geometry.attributes["tangent"].count;
  var geometry = BufferGeometry();

  var positions = Float32BufferAttribute(Float32Array(nTangents * 2 * 3), 3);

  geometry.setAttribute('position', positions);

  var vth = VertexTangentsHelper.create(geometry, LineBasicMaterial({"color": color, "toneMapped": false}));

  vth.object = object;
  vth.size = size;
  vth.type = 'VertexTangentsHelper';

  //

  vth.matrixAutoUpdate = false;

  vth.update();

  return vth;
}