VertexTangentsHelper constructor
object
-- object for which to render vertex tangents.
size
-- (optional) length of the arrows. Default is 1.
color
-- (optional) hex color of the arrows. Default is 0x00ffff.
Implementation
factory VertexTangentsHelper(Object3D object, [double size = 1, int color = 0x00ffff]) {
final nTangents = object.geometry?.attributes["tangent"].count;
final geometry = BufferGeometry();
final positions = Float32BufferAttribute.fromList(Float32List(nTangents * 2 * 3), 3);
geometry.setAttributeFromString('position', positions);
final vth = VertexTangentsHelper.create(geometry, LineBasicMaterial.fromMap({"color": color, "toneMapped": false}));
vth.object = object;
vth.size = size;
vth.type = 'VertexTangentsHelper';
vth.matrixAutoUpdate = false;
vth.update();
return vth;
}