viro
viro copied to clipboard
Feature Request - Dynamic AR Tracking Targets
While creating a tracking target, you cannot have a source be from a URI. If a developer wanted to store tracking targets in a database, and then fetch them and dynamically create targets for users, they cannot.
ViroARTrackingTargets.createTargets({
targetOne: {
source: {uri: props.sceneNavigator.viroAppProps.image},
// source: require('../../assets/image_marker.png'),
orientation: 'Up',
// physicalWidth: 0.32, // real world width in meters
physicalWidth: 0.1, // real world width in meters
},
});
I believe the ::createTargets can be called at anytime, am I right?
@robertjcolley I create targets during the running of the app and the image sources are server side, can show you it working if you like?
Hi I use dynamic target from firebase and it is working well since a long time. i donβt use viroappproprops because I parse my firebase (json) to extract all data of a viro scene. i was having issue when the create target was call too early and the data from redux was not already retrieve. As @doranteseduardo say it can be called at any time. i can make a little repro if needed.
@Foosballfan @Cchumi If one of you references a small repo, I can update the docs and close this issue. Thanks!
This was in response to someone having an issue. If working correctly, I'll close!
There is a problem with files stored on the device - it seems the library works with either bundled files or remote, but it I'm trying to specify:
source: {uri: `file:///var/mobile...`},
I got Error converting data into image target
and in the stack I see [VRTARImageTargetPromise fetch]_block_invoke
There is a problem with files stored on the device - it seems the library works with either bundled files or remote, but it I'm trying to specify:
source: {uri: `file:///var/mobile...`},
I got
Error converting data into image target
and in the stack I see[VRTARImageTargetPromise fetch]_block_invoke
I looked at the source code. That error means that is successfully download the image from the URL but the data wasn't recognized by the platform as a known image type and failed creating the native UIImage from the data. Check to ensure that it's a common image type and check the download link that it's actually pointing to an image.