flutter cube a 3d widget
a flutter 3d widget that renders wavefront’s object files.
getting started
add flutter_cube as a dependency in your pubspec.yaml file.
dependencies:
flutter_cube: ^0.0.1
add wavefront’s object files to assets.
flutter:
assets:
- assets/cube/cube.obj
- assets/cube/cube.mtl
- assets/cube/flutter.png
import 'package:flutter_cube/flutter_cube.dart';
... ...
@override
widget build(buildcontext context) {
return scaffold(
body: center(
child: cube(
onscenecreated: (scene scene) {
scene.world.add(object(filename: 'assets/cube/cube.obj'));
},
),
),
);
}
screenshot
Comments are closed.