Log in or register to post comments

1-to-1 associate image target to 3D model by name in code

July 25, 2018 - 5:58am #1

I feel like this is simple enough that it has been answered, but I just can't find exactly what I'm looking for.

I want to have a dataset with a number of image targets, eg. car, bus, person, etc. I also want to have one 3D model that directly corresponds to each of these targets, eg. car.fbx, bus.fbx, person.fbx, etc. Then, all I want to do is programmatically associate each image target with it's relevant 3D model, using names/filenames.

Any tips?

1-to-1 associate image target to 3D model by name in code

July 25, 2018 - 9:25pm #3

Thanks for the pointers, dpizzle. I'll give the dictionary of prefabs approach a go first.

1-to-1 associate image target to 3D model by name in code

July 25, 2018 - 8:10am #2

Lots of ways to do this. Maybe consider a dictionary of prefabs that are loaded from the Resources folder with the key being the target name.   Then in OnTrackingFound, get the trackable name, look it up in the dictionary then load the prefab.

Another way is to break things up by scene, have your ARCamera and image targets in a main scene, then load additional model scenes additively.   This is useful if each targets content is fairly complicated with lighting, animation, etc, because you can edit the individual scenes content separately.   



 

Log in or register to post comments