0

I'm struggling fo find anything like "Augmented Model visualizer" or another method how to attach a model to a detected target image.

I have tried to place the model (capsule) on the scene, with& without Augmented image visualizer, tried to child the model to every component in the hierarchy

I hopped the model to derive its location from its parent position, but in all the tests the object kept floating in the air constantly and not attach itself to any particular spot in the area, but on the screen.

edit: to make sure this is what you recommended to do (in the right place)

enter image description here

likuku
  • 358
  • 6
  • 21

1 Answers1

1

You can do it by creating a capsule prefab and adding these lines to your AugmentedImageExampleController where you create the visualizer and create an anchor for it like this:

var obj = Instantiate(capsule, anchor.transform.position,anchor.transform.rotation);
obj.transform.parent = anchor.transform;
Ali Kanat
  • 1,888
  • 3
  • 13
  • 23
  • so if it's not a capsule in the end product but a complex game object, just create it, prefab it all and anchor it the way you described - correct? no difference in that matter.. and fitToScreenOverly stays the same? – likuku Jan 09 '19 at 14:51
  • Yes you can have any prefab you want. However, fitToScreenOverlay is something different. If you are asking it for adjusting the size of your prefab or model you have to do it on your own. You can calculate the extents of image using `image.ExtentX` and `Image.ExtentZ` and adjust size of your object accordingly or you can adjust it in the editor by changing the size of prefab itself. – Ali Kanat Jan 09 '19 at 14:59
  • gatcha thank's alot I added the image of the code so we can make sure i got your instructions correctly and save the error phase – likuku Jan 09 '19 at 15:04
  • Good idea. It should do the trick. Let me know if any issues come up i can try to help further. – Ali Kanat Jan 09 '19 at 15:07