createObject method

  1. @override
Mesh createObject(
  1. dynamic geometry, [
  2. List<MeshBasicMaterial>? materials,
  3. Map<String, dynamic>? options
])
override

Creates and returns a mesh object with the specified geometry and materials.

Implementation

@override
Mesh createObject(dynamic geometry,
    [List<MeshBasicMaterial>? materials, Map<String, dynamic>? options]) {
  final dynamic object =
      Mesh(geometry, materials ?? ThreeUtils.createMaterials());
  object.position.z = -1;
  object.rotation.x += 7;
  object.rotation.y += 7;

  if (options != null) {
    if (options['scale'] != null) {
      object.scale.set(options['scale']['x'], options['scale']['y'],
          options['scale']['z']);
    }
  }

  sceneController.addElement(object);
  return object;
}