1

Is it possible to get the real world coordinates form the original model in the Forge viewer? It looks like when a model is loaded into the Viewer it is placed with the center of the model in the origin of the Viewer.

FrodeTo
  • 83
  • 1
  • 10

2 Answers2

2

viewer.model.getData().globalOffset is what you are looking for: Aligning Coordinate Systems in Autodesk Forge Viewer

Community
  • 1
  • 1
Felipe
  • 4,325
  • 1
  • 14
  • 19
0

Afaik, the Forge viewer centres the model. In other words, the origin of the viewer coordinate system is the centroid of the model. The scale of the model remains unchanged. As a result, you can transform the original model coordinates to Forge viewer and vice versa simply by adding or subtracting the model centroid.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Thanks for the answer, Jeremey. Do you know if the original model coordinates is located somewhere in the viewer model? If a customer uploads a model we do not know these values. – FrodeTo Mar 30 '17 at 08:36
  • Hi Frode, Probably not in general. Also, the details will always depend on the seed CAD file, e.g., the source authoring system. – Jeremy Tammik Mar 30 '17 at 11:50