Log in or register to post comments

Smart Terrain Initialization

January 7, 2016 - 4:09pm #2

Hi,

Im trying to find a way to initialize smart terrain by code but always fail and get error,

The API says that the SmartTerrainTracker class should to have a method SetInitializationTarget but is not a member of the class once i get the instance.

SmartTerrainTracker mtracker = TrackerManager.Instance.GerTracker<SmartTerrainTracker>();

Only ImageTargetBehaviour have a member SetASmartTerrainInitializationTarget but I keep  getting error when i try to set on runtime.

I just try to set an ImageTarget as a initialization target for a smart terrain prefab at runtime.

Can you show me a properly way to acomplish that?

Regards

Mariano

 

Smart Terrain Initialization

January 9, 2016 - 10:21am #1
  SmartTerrainTracker mTracker = TrackerManager.Instance.GetTracker<SmartTerrainTracker>();

   ReconstructionBehaviour rb = FindObjectOfType(typeof(ReconstructionBehaviour)) as ReconstructionBehaviour;
   ReconstructionFromTargetBehaviour rftb = FindObjectOfType(typeof(ReconstructionFromTargetBehaviour)) as ReconstructionFromTargetBehaviour;
   ImageTargetBehaviour itb = mTrackableBehaviour.gameObject.GetComponent<ImageTargetBehaviour> ();
  
   rftb.ReconstructionFromTarget.SetInitializationTarget((ImageTarget)mTrackableBehaviour.Trackable, new Vector3(0f, 0f, 0f), new Vector3(100f, 100f, 100f));

Hi,

I move a little forward but still cant get it working,

 

I put this lines on code on the DefaultTrackableEventHandler OnTrackingFound() method and now I get this message

"Trackable MyTrackable set as Smart Terrain initialization target".

But still nothing, i dont know if this i similar to click on "Smart Terrain" checknox on ImageTarget on Inspector.

Seems like I still lack something more, I must do something else with reconstruction, smartterrainbuilder, etc? Sorry I still feel confusing about the smart terrain API

Thanks

 

Mariano

 

Log in or register to post comments