All events for addEventListener


(Udson0027) #1

Hi all,
I’m looking for all events can I use in api.addEventListeners.
Where can I found this?

Thanks


(Mauricesvay) #2

All supported events are documented here: https://sketchfab.com/developers/viewer/functions#api-section-events


#3

Actually, it’s missing the documentation for the click event:

api.addEventListener( 'click', function (e) {
    // Do stuff
});

Where

e.position3D is the coordinates of the click in 3D space
e.position3D is the coordinates of the click in the 2D canvas
e.normal is the vector of the normal at that point
e.instanceID is the clicked geometry node’s ID
e.material is the clicked material object