ShapeDiver: How to adjust zoom extents?

I have two question regarding the automatic Zoom Extents.

  1. How can I manually adjust the zoom factor? When I press zoom extents or it gets triggered by a new geometry, it sort of fits the geometry in the center, but fits it in the viewport so that it fills roughly 1/2 of the screen both horizontally and vertically:

Since we are embedding the viewer in a website where the background matches, we would want the object to be fitted to fill more of the screen.

Zoom extents obviously does fit it in the viewport, but then you have a factor somewhere to have some space around the object. We would need to adjust this factor.

  1. Talking of the Zoom Extents and the starting position. It seems like you are calculating Zoom Extents differently to how we did it in other software tools. Normally the pitch and yaw of the camera stays the same and only the position and distance of the camera are adjusted, because all you are doing is calculating the new distance and setting the position to the new bounding box center.

You somehow do it differently, because when I start with a small object and have the camera set at a starting position as in the image above, but then have the script create a much larger object, the angle of the camera now changes dramatically and I am looking at the object from the bottom.

It’s like you are leaving the camera position unchanged and instead only re-calculate distance and simply turn the camera to face the object.

At least as an option I would rather keep the angle I am looking at an object the same, even if the size changes.

I know we can calculate and set our own camera positions, but we are using the Shopify “plugin”, which means we can’t easily add this functionality.

Regarding your first question: there is a Zoom Factor setting as part of the active camera in your scene, it should do what you expect:

Regarding your second question: I absolutely agree with your remark, I think the behaviour of the zoom extents functionality should be updated. I filed a bug for our team, this should be updated soon in the future.

1 Like

Thanks, @mathieu1!

I did indeed find the zoom factor now and it does what we need for point 1. I always thought it didn’t really do anything, because when you change it, nothing changes in the viewport, you need to press the Zoom Extents button again manually, where as with most other sliders, you immediately see a change.

From experience I know that a target camera that is controlled by pitch, yaw and distance is much more intuitive than using X, Y, Z coordinates. Since you are always facing the target, you want to move around it in a spherical motion. That way, setting a pitch and yaw should than mean that the pitch and yaw stay the same when doing the zoom extents, because you are simply moving the target (and therefore equally the camera) to the new bounding box center and only calculating a new distance. That is how something like “Frame selected” works in Rhino and also how it works in most of the 3D tools I know.

I would actually like to set the camera angle and then turn off rotation in the viewport completely. Currently that is not feasible as the camera angle will change between creations.

Thanks for adding some options or improvements there!

I also noticed another bug:

At least in the Shapediver backend, when I change the text and therefore a new geometry is created, it does a Zoom Extents as soon as a new geometry is created. But the size it uses for the Zoom Extents appears to be always the one from the old geometry. Look what happens when I change between a short and long text:

ezgif-6-9e1c4c6576

Now I also understand why the camera is behaving so weirdly. It is using the target geometry from the previous creation and not the new one!

I just did a little test and the zoom bug only seems to exist in the Edit view of a model on Shapediver. When I save and close it works correctly. Still would be nice to fix it. Thanks!

Any updates on this? We really need a fixed camera angle auto-zoom and not fixed camera position auto-zoom. Otherwise I have to actually do the calculation for the new camera center and position in Grasshopper, output both and then build a Javascript to update the camera position and target. But it would have to somehow intercept whenever it does an autozoom and use the other values instead. Or we would have to totally disable autozoom and basically build our own inside our script, which would be a bit weird.

Please make auto-zoom work like everywhere else, including Rhino! When you do zoomSelected, it will always keep the camera angle the same.

I mean all you have to do is when you do the auto-zoom you add the vector from old target to new target also to the camera position. It’s like less than a line of code :wink:

@seltzdesign We updated the behaviour of the auto-zooming in the viewer. Please test and let me know if it works as you expect now.

1 Like

Thanks, it works beautifully and as expected now :slight_smile:

1 Like

Hello again. I am trying to find the Release Notes to see where the changes have taken place, but the Release Notes here: Viewer Release Notes Stop at Version 3.4. I can see that on your website you are using viewer Version 3.7.

Is there a new place for the changelog?

You are right that the release notes are lagging behind, as several versions were released at the end of last year. The help center will be updated next week, including the information you are requesting.