@@ -26,8 +26,8 @@ A Flutter package for rendering interactive 3D models in different formats(glb,
26
26
27
27
## Samples
28
28
29
- <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model1.png " alt =" Model1 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model2.png " alt =" Model2 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model3.png " alt =" Model3 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model4.png " alt =" Model3 " width =" 24% " />
30
- <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model1.gif " alt =" Model1 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model2.gif " alt =" Model2 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model3.gif " alt =" Model3 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/master /example/samples/model4.gif " alt =" Model3 " width =" 24% " />
29
+ <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model1.png " alt =" Model1 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model2.png " alt =" Model2 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model3.png " alt =" Model3 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model4.png " alt =" Model3 " width =" 24% " />
30
+ <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model1.gif " alt =" Model1 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model2.gif " alt =" Model2 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model3.gif " alt =" Model3 " width =" 24% " /> <img src =" https://raw.githubusercontent.com/m-r-davari/flutter_3d_controller/dev /example/samples/model4.gif " alt =" Model3 " width =" 24% " />
31
31
32
32
33
33
## Compatibility
@@ -44,16 +44,43 @@ A Flutter package for rendering interactive 3D models in different formats(glb,
44
44
## Brief Example
45
45
46
46
``` dart
47
- /// create controller object to control 3D model.
47
+ // create controller object to control 3D model.
48
48
Flutter3DController controller = Flutter3DController();
49
49
50
- /// controller functions,
51
- /// Play method will play 3d model animation, you can use it to play or switch between animations
50
+ // It will play 3d model animation, you can use it to play or switch between animations.
52
51
controller.playAnimation();
53
- /// If you pass specific animation name it will play that specific animation
54
- /// If you pass null and your model has at least 1 animation it will play first animation
52
+
53
+ // If you pass specific animation name it will play that specific animation.
54
+ // If you pass null and your model has at least 1 animation it will play first animation.
55
55
controller.playAnimation(animationName: chosenAnimation);
56
56
57
+ // It will pause the animation at current frame.
58
+ controller.pauseAnimation();
59
+
60
+ // It will play animation from first frame (from beginning).
61
+ controller.resetAnimation();
62
+
63
+ // It will return available animation list of 3D model.
64
+ await controller.getAvailableAnimations();
65
+
66
+ // It will load desired texture of 3D model, you need to pass texture name.
67
+ controller.setTexture(textureName: chosenTexture);
68
+
69
+ // It will return available textures list of 3D model.
70
+ await controller.getAvailableTextures();
71
+
72
+ //It will set your desired camera target.
73
+ controller.setCameraTarget(0.3, 0.2, 0.4);
74
+
75
+ // It will reset the camera target to default.
76
+ controller.resetCameraTarget();
77
+
78
+ //It will set your desired camera orbit.
79
+ controller.setCameraOrbit(20, 20, 5);
80
+
81
+ //It will reset the camera orbit to default.
82
+ controller.resetCameraOrbit();
83
+
57
84
```
58
85
59
86
``` dart
0 commit comments