Hi Guys, please help me. I created a project based on ArCore Augmented Images Example. I have 3 images in my Augmented Image Database and 3 different 3d objects(prefabs). I don't know how to assign a different object to each image. My app assigns only one object to all images. Please help. Thank you.
G'day AlexandruStrujac,
ARCore provides an Augmented Image Object when an image is detected. You can use either getName() or getIndex() to find out which image it is. Use the provided Pose via getCenterPose() to then position your 3D content relative to the marker, or attach an anchor and listen for updates per frame, moving your content accordingly.
Hope that helps!
Thank you. I am noob on this, i will try to figure it out how to create what you said.
David, can you help me with a code example, please?
G'day AlexandruStrujac,
Have you had a chance to examine the official examples by the google team? Have a look at updateModelMatrix() function and draw() function. This is one such example. To make some sense of these examples some basic Matrix/Vector Math helps.
Also take a look at drawAugmentedImages() function which outlines how the images are detected via the onDrawFrame function. onDrawFrame is called via OpenGL at roughly 30FPS (or lower depending on the rendering load). Everything you need is there!
From the question (I see the word "prefab") it sounds like this might be about our Unity integration. If so please post on the google-ar/arcore-unity-sdk issues board.
Closing for inactivity.
Most helpful comment
G'day AlexandruStrujac,
ARCore provides an Augmented Image Object when an image is detected. You can use either getName() or getIndex() to find out which image it is. Use the provided Pose via getCenterPose() to then position your 3D content relative to the marker, or attach an anchor and listen for updates per frame, moving your content accordingly.
Hope that helps!