Skip to content
Advertisement

SparkAR – how to track a plane surface (not image target)?

Is there any way to implement target tracking in SparkAR, but track the current plane where the 3d object is placed, instead of a predefined target image?

So, for example, I’m placing a 3D object on a paper with a drawing, and when I move the paper around, the object should stick to it. But it can be any drawing, not some predefined target image. It already works like this with a plane tracker, the only problem is that it works if I move, but not if the plane itself moves.

Advertisement

Answer

According to the documentation, there is a MOVING_OBJECT option inside the tracking mode ENUM (https://sparkar.facebook.com/ar-studio/learn/reference/enums/scenemodule.trackingmode/) that could be what you’re looking for? You can access the enum through the scene module, I think, and then declare that the tracking mode you want for X object on the scene is this one (you can find some good tutorials on yt, but this https://github.com/jordyhenry/PlaneTracker.trackingMode might be a good start).
But bear in mind that vertical_plane, for example, simply does not work anymore. So you’d have to try and see if the moving_object one is still a thing – fb does not seem worried about retrocompatibility so they just… stop using things on updates.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement