0

I am trying to achieve same thing which is done in this Video. need a implement a walk through which navigates through all the model in the rendered file. Could someone tell me how its been done or what is it called in autodesk language so that I can find it out on autodesk documentation and try to implement it.

I read it somewhere where it says it need to be implemented while create the RVT file and then it needs to be rendered is it true ?

A reference to sample or document would be a great help.

Ronak Shetiya
  • 960
  • 6
  • 27

2 Answers2

2

it called getState and restoreState in Autodesk Forge.getState give you information about current viewport. First, get state through var currentState = viewer.getState({viewport: true}) and save currentState somewhere, then you call it through viewer.restoreState(currentState) to get viewport you already saved.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Paxton.Huynh
  • 172
  • 10
2

Yes, this can be done in a couple of ways:

  • as Paxton said, you can use the getState/restoreState functionality; the "state" includes information such as camera position, IDs of selected objects, IDs of hidden objects, section planes, etc. but these can be filtered out.
  • alternatively, you could store the camera info manually (for example, using viewer.navigation.getPosition(), viewer.navigation.getTarget(), and viewer.navigation.getCameraUpVector()), and then transitioning to this camera setup using setView, or using the (undocumented) method viewer.navigation.setRequestTransition(true, newCameraPos, newCameraTarget).
Petr Broz
  • 8,891
  • 2
  • 15
  • 24
  • I was able to get the sates but while restoring I am not able to find a way to show a smooth transition could u please refer me to some code which I can implement ? Also I was not able to find any reference for setRequestTransition, let me know if u have some reference for it too – Ronak Shetiya Sep 22 '20 at 13:34
  • 1
    The 3rd parameter to the `restoreState` method is an `immediate` flag. If you set it to false, the new camera state should be smoothly transitioned to, e.g., `viewer.restoreState(state, null, false);`. – Petr Broz Sep 22 '20 at 13:57
  • Regarding the `setRequestTransition` method, I've no idea why it's not included in the docs. I'll report the issue to the docs team. – Petr Broz Sep 22 '20 at 14:03