omchiii / model_viewer_plus.dart

A Flutter widget for rendering interactive 3D models in the glTF and GLB formats.
https://pub.dev/packages/model_viewer_plus
Apache License 2.0
92 stars 51 forks source link

How to dynamically update the state of a 3D model? #32

Open yanwenjun opened 2 years ago

yanwenjun commented 2 years ago

I am using ModelViewer widget in Flutter project, I dynamically update the orientation value through flutter's setState method. But it doesn't rotate the 3D model to the orientation specified by roll, pitch, yaw. In the comments I saw that the updateFraming() method needs to be used manually to update, but I didn't find this method. How can I update the 3D model?

ModelViewer(
    backgroundColor: Color(0xFF131313),
    src: 'assets/3d/abc.glb', // a bundled asset file
    alt: "3D model",
    arModes: ['scene-viewer', 'webxr', 'quick-look'],
    autoRotate: false,
    autoPlay: true,
    cameraControls: true,
    orientation:"${rollPitchYaw[0]} ${rollPitchYaw[1]} ${rollPitchYaw[2]}",
  ),
bluemoon-i commented 2 months ago

hi, how you finnaly fix?