Fit View Behavior

While using,
GLRenderer.frameAll();
the model zoom is adjusted so as to get the model within visible region of the viewport. However, the model is still seen small. Is there a way to make it fit at a bigger size (in a more zoomed in state).

How can I achieve it?

Thanks!

It might be that the bounding box is incorrect.

You an display the bounding boxes using the BoundingBox pass.

      // Setup a Bounding Box pass to display all
      // the bounding boxes of the items in the scene.

      const boundingBoxPass = new GLBoundingBoxPass()
      renderer.addPass(boundingBoxPass)
      boundingBoxPass.addTreeItem(scene.getRoot(), true)

Is there any chance you could send us a sample file to checkout? This issue might have already been addressed.

Phillip,

Thanks for the support!

I have attached the .zcad file that I used. I have also attached an image of full graphics canvas (FitView_Current.png). You can see the current fit view outcome. The bounding box seems incorrect.

What I would expect is something close to what is shown in other attached image (FitView_Expected.png)

Regards,

  • Shailesh

(Attachment Part3.zcad is missing)

Could you also send the original SW file?

image005.png

image006.jpg

Here’s the SW file….

image005.png

image006.jpg

(Attachment Part3.SLDPRT is missing)

The zcad converter had some issues that were highlighted by this file in particular.
The next engine update will support accurate bounding boxes as shown here.

That’s a good news. This is looking better…

Next engine update meaning 3.6 or the next to this one??

Regards,

  • Shailesh

There were a couple of issues that we reviewed related to this. The ZeaSpatialBridge now produces more accurate bounding boxes, but they are still approximate during load. The approximate bounding boxes make loading faster, and in many cases are fine. Especially in scenes containing many thousands of small parts.

However, precise bounding boxes must be computed based on the actual geometry vertices, and the current transformations being applied. So now the engine now supports calculating these precise bounding boxes after the geometries load.

You can see the PR here: https://github.com/ZeaInc/zea-engine/pull/397

The next release will be fairly minor and contain this change. (3.7.0)
You will also need an update to the ZeaSpatialBridge which contains a couple of other fixes also relevant to you. We will make this available to you shortly.

1 Like