AxesHelper constructor
AxesHelper([
- num size = 1
size
-- (optional) size of the lines representing the axes.
Default is 1
.
Implementation
factory AxesHelper([num size = 1]) {
List<double> vertices = [
0,
0,
0,
size.toDouble(),
0,
0,
0,
0,
0,
0,
size.toDouble(),
0,
0,
0,
0,
0,
0,
size.toDouble()
];
List<double> colors = [
1,
0,
0,
1,
0.6,
0,
0,
1,
0,
0.6,
1,
0,
0,
0,
1,
0,
0.6,
1
];
final geometry = BufferGeometry();
geometry.setAttributeFromString('position',Float32BufferAttribute.fromList(vertices, 3, false));
geometry.setAttributeFromString('color',Float32BufferAttribute.fromList(colors, 3, false));
final material =
LineBasicMaterial.fromMap({"vertexColors": true, "toneMapped": false});
return AxesHelper.create(
size: size, geometry: geometry, material: material);
}