Skip to content Skip to sidebar Skip to footer

Model Aggregating In Viewer - Coordinate Issue

I am dynamically aggregating models in the Viewer (coming from multiple BIM files). Basically, I initialize the viewer, and then LoadDocument and LoadModel for each model that user

Solution 1:

ok, so there is a massive offset, causing a precision issue. Which is why you are seeing lots of 'jittering' of the camera.

To fix this... we need to correct the massive offset, by returning all the geometry closer to origin manually. (or fixing the original navisworks file).

First, let's roughly figure out the offset value...

Hold down ALT-key and click anywhere on an object. This sets a green dot, the pivot point. Then use viewer.navigation.getPivotPoint() to get the x,y,z value. (details: https://github.com/wallabyway/markupExt/issues/2).

You should see an xyz value like this... Z.Vector3 {x: 1296285.515098644, y: 14995636.431742325, z: 364.26238179027337}

Now, adjust set the global offset using this value, to correctly move all the models closer to 0,0,0. like this...

line 70:

var modelOptions = {
    sharedPropertyDbPath: doc.getPropertyDbPath(),
    globalOffset: {x:1296285.515098644, y: 14995636.431742325, z:0}
};
viewer.loadModel(svfUrl, modelOptions, onLoadModelSuccess);

`

This reverses the effect of this big offset. The result is the geometry stops flickering and the camera movement stops 'jittering' due to precision issues.

Let me know if that works for you. Michael

ps. you can pull the 'exact' global-offset out of the small side-file AECModelData.json, see blog: forge.autodesk.com/blog/add-revit-levels-and-2d-minimap-your-3d


Post a Comment for "Model Aggregating In Viewer - Coordinate Issue"