Skip to content

Hi, I want to use imodel.js To achieve roaming along the specified path. #548

Answered by pmconne
shenshengyi asked this question in Q&A
Discussion options

You must be logged in to vote

Implement a viewport animator and apply it to a Viewport.
In your Animator's animate 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 from animate when you reach the end of your path, to terminate the animation.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shenshengyi
Comment options

Answer selected by shenshengyi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants