hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.16k stars 399 forks source link

[feature request] event to detect image target transform change #294

Closed marcusx2 closed 1 year ago

marcusx2 commented 1 year ago

There's already an event to detect when an image target is found or lost, but it would be nice to also have an event that fires if the image target's position, scale or rotation changes. "ontransformchange", or something like that. It would probably fire all the time. But I'm thinking it would be more efficient than using requestanimationframe or tick or tock.

The use case here is that I do not place the content inside the a-entity, but rather I'm just polling the entity to get the transform every frame and apply it somewhere else. And event like "ontransformchange" would be useful.

hiukim commented 1 year ago

added in v1.2.1 https://github.com/hiukim/mind-ar-js/commit/7740932205a0bb9591d3b99ea2610cc0a1d4fb2d