Sketchfab Forum

Model, camera and light rotation


(Klaasnienhuis) #1


I'm working with the viewer API and I've built a few buttons with preset camera angles next to my embed. This gives my users the option to freely navigate the model but also pick from a front/side/closeup view. I also switched the autospin option in my embed on. But that was a bad idea.

I always assumed autospin rotates the camera, but it doesn't. The model is rotated (if I'd paid attention I would have known...). This makes my buttons with my preset camera angles obsolete since I can't put the model back at it's original rotation when picking a camera angle. In order to have the autospin AND preset camera angles I'd need to be able to reset the model rotation through the API.

As an alternative the viewer could have an extra parameter to automatically spin the camera "cameraspin". Autospin and cameraspin would need to be mutually exclusive of course.

In addition to that, another viewer option to automatically spin the lights would be awesome: "lightspin". It really helps to sell a model when there's a bit of 3D movement. However, sometimes you don't want to move the model because of a specific camera angle. Moving the lights is a great alternative. I know you can do this by hand, but having an automatic lightspin is really neat.


Viewer API: getCameraLookAt() ignores autospin model rotation

Definitely some great ideas! I completely agree that autospin and lookAt playing nicely together (or a separate cameraspin) would be a big improvement. "lightspin" would also be a nice feature.

@cedric @stephomi thoughts?

(Klaasnienhuis) #3

Hi @james,
with my recent projects I've consistently come across the requirement to have a few preset camera angles. But clients also want to have the autospin feature to trigger site visitors to actually interact with the 3D model. Like I describe above having autospin and preset camera angles are incompatible.

Before I start to hack my own autospin together I just wanted to check if you're considering this feature in the near future.

(Shaderbytes) #4

Camera orbit has come up before in the past, it is probably the most expected behaviour but if you want to use the autospin feature while having camera orbiting - some decisions into how to handle all edge cases need to be made. Firstly lets not forget the user can translate or zoom the camera at any time. So you have to decide how to handle your focus point when resuming autospin as well as how to handle the rotation.

The best solution is that autospin should have a defined focus point on the model , radius for orbit and initial rotation. After a user stops interacting with the scene and autospin is about to start , the camera should be animated back to these pre defined values for autospin.


I fully agree with predefined camera positions , the annotation system already solves half the issue except for the fact that you cant set annotations to be hidden in the editor .. or via the api. I have flagged this need already on the slack discussions board. Going one step further even if these are exposed to us , the current hide logic still leaves the annotation paging UI on screen and only hides the annotation points themselves. Ideally we need to be able to hide both. Then predefined camera angles is sorted :wink:

(Klaasnienhuis) #5

currently I just use the API to place the camera to coordinates I've specified. This gives me the preset camera angles.
As for the camera orbit focus, it could work like you describe. Since the autospin doesn't kick in immediately but after a few seconds, it makes sense for the view to reset itself before the autospin (or autoorbit) starts again.