Problem with camera limitation and simultaneous model comparison


(Empe2301) #1

Hi,

I have a big problem with a mechanism of comparison 3d models, with a limited camera. So, I used the solution below: https://github.com/sketchfab/experiments/tree/master/compare-models and comparison works well if I do not write my own code :smiley:

But unfortunately I need an additional solution: I want to block the possibility of entering the car, going out of the realm and looking under the floor. This solution supports code from 12778 js to 12848 js and this works fine if I do not use a comparator at the same time. In this case I have strange effect: Models flash several times before they set properly. Besides, camera limitation does not work well, you can look up to the floor and then it is flashing.

Maybe someone knows how to eliminate this terrible effect? Please help!

Codepen:

https://codepen.io/emka123/pen/eWddzv


#2

I made a quick demo of zoom with limitations here: https://forum.sketchfab.com/t/viewer-api-zoom-demo/3524

We're also going to implement proper camera limitations in the viewer very soon. This should make your project much easier.

I'm not sure about the camera flashing, it seems to be a side effect of your camera polling but I did not dig that closely yet.

Copying our full experiment code with jQuery, underscore, Backbone, etc. is probably not necessary.