Hi, I want to use imodel.js To achieve roaming along the specified path. #548
-
Hi, I want to use imodel.js Realize roaming along the specified path. For example, if I draw a path and then roam along the path, can you provide me with an idea? thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Implement a viewport animator and apply it to a Viewport. |
Beta Was this translation helpful? Give feedback.
Implement a viewport animator and apply it to a Viewport.
In your
Animator
'sanimate
function, interpolate along your path based on the time elapsed to determine where the camera should be positioned and how it should be oriented. You may find functions like fractionToPoint useful for this. Then adjust the viewport's frustum correspondingly.Return
true
fromanimate
when you reach the end of your path, to terminate the animation.