create static method

Future<Axis> create(
  1. ThermionViewer viewer
)

Implementation

static Future<Axis> create(ThermionViewer viewer) async {
  final xAxis = await viewer!.createGeometry(
      Geometry(Float32List.fromList([0, 0, 0, 10, 0, 0]), [0, 1],
          primitiveType: PrimitiveType.LINES),
      materialInstance: await viewer!.createUnlitMaterialInstance());
  final yAxis = await viewer!.createGeometry(
      Geometry(Float32List.fromList([0, 0, 0, 0, 10, 0]), [0, 1],
          primitiveType: PrimitiveType.LINES),
      materialInstance: await viewer!.createUnlitMaterialInstance());
  final zAxis = await viewer!.createGeometry(
      Geometry(Float32List.fromList([0, 0, 0, 0, 0, 10]), [0, 1],
          primitiveType: PrimitiveType.LINES),
      materialInstance: await viewer!.createUnlitMaterialInstance());

  await viewer!.setMaterialPropertyFloat4(
      xAxis, "baseColorFactor", 0, 1.0, 0.0, 0.0, 1.0);
  await viewer!.setMaterialPropertyFloat4(
      yAxis, "baseColorFactor", 0, 0.0, 1.0, 0.0, 1.0);
  await viewer!.setMaterialPropertyFloat4(
      zAxis, "baseColorFactor", 0, 0.0, 0.0, 1.0, 1.0);
  return Axis._(xAxis, yAxis, zAxis, viewer);
}