Following this link https://developer.vuforia.com/forum/faq/android-how-do-i-add-another-target-video-playback-sample, i can add more videos and imageTarget to the app but to determine them dynamically is my major problem. I can parse an XML for the dataset and determine number of imagetargets from there and also the names which i can send to the C++ side. My question now is how do i make this code dynamics, Arrays don't seem to be working for me because the code in the C++ feels too static. example like this and other places
GLfloat videoQuadTextureCoordsTransformedStones[] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, }; GLfloat videoQuadTextureCoordsTransformedChips[] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, };
if (target == STONES) { uvMultMat4f(videoQuadTextureCoordsTransformedStones[0], videoQuadTextureCoordsTransformedStones[1], videoQuadTextureCoords[0], videoQuadTextureCoords[1], mtx); uvMultMat4f(videoQuadTextureCoordsTransformedStones[2], videoQuadTextureCoordsTransformedStones[3], videoQuadTextureCoords[2], videoQuadTextureCoords[3], mtx); uvMultMat4f(videoQuadTextureCoordsTransformedStones[4], videoQuadTextureCoordsTransformedStones[5], videoQuadTextureCoords[4], videoQuadTextureCoords[5], mtx); uvMultMat4f(videoQuadTextureCoordsTransformedStones[6], videoQuadTextureCoordsTransformedStones[7], videoQuadTextureCoords[6], videoQuadTextureCoords[7], mtx); } else if (target == CHIPS) { uvMultMat4f(videoQuadTextureCoordsTransformedChips[0], videoQuadTextureCoordsTransformedChips[1], videoQuadTextureCoords[0], videoQuadTextureCoords[1], mtx); uvMultMat4f(videoQuadTextureCoordsTransformedChips[2], videoQuadTextureCoordsTransformedChips[3], videoQuadTextureCoords[2], videoQuadTextureCoords[3], mtx); uvMultMat4f(videoQuadTextureCoordsTransformedChips[4], videoQuadTextureCoordsTransformedChips[5], videoQuadTextureCoords[4], videoQuadTextureCoords[5], mtx); uvMultMat4f(videoQuadTextureCoordsTransformedChips[6], videoQuadTextureCoordsTransformedChips[7], videoQuadTextureCoords[6], videoQuadTextureCoords[7], mtx); }
if i have like 15 or more images, would i have to define this for every image targets across the code?.. I have tried to make it a bit more dynamic but is not working. Please how can i make this more dynamic? am not asking you provide a complete solution (would be nice.. :) ) but at least a guidance will be highly appreciated!!
Thank you.
Possible to make ImageTargets and VideoPlayback more dynamic?
One possibility would be to use C++ STL vectors, as this allows handling dynamic arrays easily.
See also this:
https://developer.vuforia.com/forum/faq/android-can-i-use-stl-vuforia
Possible to make ImageTargets and VideoPlayback more dynamic?
ok thanks. i will try that and let you know how it goes.
Possible to make ImageTargets and VideoPlayback more dynamic?
sorry to bother, but i don't seem to know how i can be dynamic in cases like videoQuadTextureCoordsTransformed where it should reflect for one target. i tried this in setVideoDimensions but i see even though they both contain the same values in array, its valid for 1 image target..