Automatic annotation creation based on center to object view

Hi Everyone.
Does anyone know how to automatically center the object, and create automatically several annotations (let’s say 11 views) based on the center object coordinates?
This will be very useful for product visualization (left, right, front, back, top, etc) without the need to do it manually, and lose consistency.
I know this link could work.
however this could be challenging with the center to object API…

X, Y, Z coordinates of the annotations - Development and API - Sketchfab Forum

Hi @guillermoaguilerarod,
you could give this a shot: https://codepen.io/klaasnienhuis/pen/zYJRegv?editors=1010
It uses the focusOnVisibleGeometries function to center the camera: Viewer API - Functions - Sketchfab

1 Like

Thank you very much @klaasnienhuis
It worked.

1 Like

Hi @klaasnienhuis Is there a way to integrate the annotation solution you sent before using the sketchfab lab screenshot page as a template Screenshots?
Basically, when choosing the 3D model in the model picker, all previously predefined annotations appear, I know that the js could be added in the home html page, however can this be integrated with the loadsketchfab model is a challenge.
The previous annotation solution uses the loadSketchfab function, how can this be replaced by the model picker, in the sketchfab screenshot experiment page?

Using screenshot viewer API use var uid= instead of loadSketchfab function which gives me some error.

Thank you again you are the best.

Hi Guillermo,
I’m not entirely clear on what you’re trying to achieve. Could you rephrase what your goal is and what you already have tried yourself to get there?

Hi @klaasnienhuis thank you again for the support.

Goal: Have a sketchfab viewer with a predefined custom annotation, screenshot integration, and a imput button for loading a 3D model directly in the HTML page.

Previous test 1: I used sketchfab screenshot experiment lab as a template to integrate a custom annotation with the already existing screenshot, 3D model loader. = unsuccessful

Previous test 2: I used the custom annotation template you sent to integrate with the screenshot viewer API = unsuccessful.

The most of the challenge is to make the scene load using a unique var uid.
There is a way to combine, custom annotation, screenshot and sketchfab model loader (HTML button.)?

I’ve updated the codepen to include rendering of the views: https://codepen.io/klaasnienhuis/pen/zYJRegv?editors=0010
That should take care of most of your requirements. You can swap out the model id in the code.
Here’s a video of me walking you through the code. I hope that helps!

Sketchfab API - Annotations and screenshots - 23 March 2023 - Watch Video

2 Likes

Thank you @klaasnienhuis you rock, this is amazing. :100:

1 Like