You have access to the viewer settings in the Edit page of your model on the ShapeDiver platform. There you can update lights, cameras, environment, etc…
Do you need to have these controls when you embed the model? Which ones precisely?
In any case, it is possible to connect the viewer settings to html controls using the API. Here is an example that connects the model parameters with a custom UI: UI example - CodeSandbox
Yes, I need it to work on the embedded model (I don’t have access to the model on the ShapeDiver platform, I just got the token and the URL to embed it).
What I need is to control the “Zoom factor” of the model. The v2 example was great, if something like that can be easily done it would be perfect, if not … even the zoom factor is enough for now.
I still do not quite understand what it is you need to be doing. I don’t think you want to expose the viewer settings to the end users of your application, what would be the reason to do that? Are you just trying to control viewer settings in general using the API? There is a specific documentation page about this, with several code examples: Viewers
In the case of the zoom factor, you can just call viewer.camera.zoomExtentsFactor = NEW_VALUE;
However, you seem to be out of luck because I just tested this setting using the API and it seems to have no effect in the latest version of the viewer. I communicated this to our team and it will be fixed soon.
Besides this issue that will be fixed shortly, is there something else that is confusing you at the moment? Does my explanation work for updating other viewer settings? For example, does it work for you if you tried to update the field of view by calling viewer.camera.fov= NEW_VALUE;
Here is a complete example on how to update the zoom factor. I had overlooked that after updating the value, one needs to call the zoomTo() function to update the camera position. Let me know if you have further questions.
The viewer section of the help center is a high level introduction with code examples to the viewer API. The full reference of the API is linked on the landing page of the viewer help center and can be found here: api/api/src | Viewer
Got it with the docs, I, personally, find it super hard to navigate unless you already know the code structure of the viewer. At least a search/filter functionality will truly help there. If the code generator doesn’t allow such a feature, there are solutions like sphinxsearch and others that can index HTML files.