Hi Peyman,
I have the same issue but only on an Android device. I load the image direct from storage not by a web request. I think the feature isn't done so far. Maybe it will fixed in the next version.
At the moment I can't help. I will try something more. If I have a solution (or you have already) I will tell you, okay?
[EDIT]
Seconds later after a very small change also the Android versiomn works for me.
This is the code:
// This method is callled after a button was clicked
public void StartTracking()
{
VuforiaARController.Instance.RegisterVuforiaStartedCallback(CreateImageTargetProjections);
}
private void CreateImageTargetProjections()
{
var objectTracker = TrackerManager.Instance.GetTracker<ObjectTracker>(); // ObjectTracker with capital 'O' not like the doumentation with lower 'o'
var dataset = objectTracker.CreateDataSet();
foreach (var imageTarget in imageTargetFiles) // I have a list of image targets
{
imageTarget.Load(); // My special object which loads an image into a Texture2D
var runtimeImageSource = objectTracker.RuntimeImageSource;
var imageTargetTexture = imageTarget.AsTexture(); // This was my little change
var imageSourceIsLoaded = runtimeImageSource.SetImage(
imageTargetTexture,
imageTarget.Dimensions.WidthInMeters, // My special object mesures its own dimensions :)
imageTarget.Name);
if (imageSourceIsLoaded){
var trackableBehaviour = dataset.CreateTrackable(runtimeImageSource, imageTarget.Name);
/// Here I have some code to put an object as child to the image target
projection.transform.parent = trackableBehaviour.transform;
projection.transform.rotation = Quaternion.Euler(90, 0, 0); // By default my assigned object have to rotat to spawn it correctly but ist only for me
}
}
objectTracker.ActivateDataSet(dataset);
}
Best Regards
jf^
Thank you .
Can you Help me to load Image target from storage in Android Step by Step?