- Sort Posts
- 48 replies
- Last post
Load 3d model through cloud
Please could you make your question clearer?
If you have the model via the asset bundle in Unity I am not sure what the problem is?
To show an augmentation it must be the child of the Image Target, so you will have to make that association at runtime using some code.
HTH
N
Load 3d model through cloud
I am new for the vuforia. So if I cannot use exact technical word then sorry for that. In vuforia example we can see that dynasoreis loaded at run time. It is a child of image target. I want that if my dynasore is store at somewhere on cloud(web) and from their load my model
Load 3d model through cloud
I cannot give you exact instructions to achieve this.
Firstly you need experience with Asset Bundles and loading the models into Unity.
Once you have done this you need to find a way of adding the model to the Image Target as a child.
Most of this is covered by the basic Unity documentation and tutorials as well as the scripting guide.
The best thing to do is to break down the problem in to smaller components, solve each problem and then build up.
N
Load 3d model through cloud
Hi janantikey,
if you have created your own asset bundle (out of a 3D model) using the BuildPipeline API of Unity, you need to make sure to add this option:
BuildTarget.Android
otherwise your asset bundle will not be compatible with Android (and that might explain why it does not show up in your test)
See here:
Load 3d model through cloud
Load 3d model through cloud
So, the same URL works in Play Mode (on PC) but not on device ?
If you are sure that the asset bundle has been generated with the BuildTarget.Android option, then it could be that the model is too large or too heavy to be rendered on mobile.
Maybe try creating a simple Cube and exporting it to Asset Bundle for Android; I did the same test in the past and it did work
(note: I just followed the Unity tutorial to achieev that, so nothing more than the code that you find in the Unity website).
Load 3d model through cloud
Load 3d model through cloud
Hi friends ,
I have loaded 3d model through cloud . Now I want different thing. I want that my target resource is on cloud db and3d model is on url . when on cloud i detect the image then 3d model should load through URL. For that I have use example provided by vudforia and make changes in code but detection is not perform I have post here my script please help me. Thanks in advance.
In target behaviour also I have chosen type cloudreco .In cloudrecobehaviour script given Accss Key and Secret Key. model is loaded on unity engine but not in device
actually detection of image is not occur like it occur in cloud reco example
Load 3d model through cloud
Hi, I would recommend youn read this article about using metadata:
https://developer.vuforia.com/forum/cloud-recognition/cloud-reco-using-target-metadata
It also contains reference to the relevant API
Load 3d model through cloud
hi all
my 3/4 th of the work is completed I can found now data from my metadata file,i which i have store url on which i have store my 3d model. From that URL I want to load my 3d model. I have make code for that but not succeded . Can you please help me. I have attach my code for same.
Load 3d model through cloud
Hi, have you checked this article:
https://developer.vuforia.com/forum/faq/unity-how-can-i-dynamically-attach-my-3d-model-image-target
This explains how you can dynamically attach a 3D model under a target at runtime (in your case this will be the model instantiated from the assetBundle);
one important thing, you need to re-parent the model, similarly to what is done in this code (see the article above for full details):
Transform myModelTrf = GameObject.Instantiate(myModelPrefab)
as
Transform;
myModelTrf.parent = mTrackableBehaviour.transform;
myModelTrf.localPosition =
new
Vector3(0f, 0f, 0f);
myModelTrf.localRotation = Quaternion.identity;
myModelTrf.localScale =
new
Vector3(0.0005f, 0.0005f, 0.0005f);
myModelTrf.gameObject.active =
true
;
Load 3d model through cloud
Load 3d model through cloud
Load 3d model through cloud
Have you been able to load and display an AssetBundle on mobile latform, without integrating it with Vuforia ?
That would be the first thing to try, to isolate the issue... I seem to understand tha something goes wrong when instantiating the assetBundle... I doubt this is caused or related to Vuforia itself...
Load 3d model through cloud
Hi
I am successful to load 3d model. Now i want to recognize more than one image from cloud database. Actually I have 2 image target right now. It can be more letter. I have 3d model url attach to it. If first image tracked and model load then if I change image target change then scaning is not start . What can i do?
Thanks in advance.
Load 3d model through cloud
You can use the DefaultTrackableEventHandler script (which is attached to each target), to get notified of when a target gets detected or lost;
this allows you to know "when" there is a change;
then you can use the StateManager class to retrieve the list of the currently active trackables, see:
https://developer.vuforia.com/resources/api/unity/class_state_manager
So, you can compare the curent list with a previous one and see what targets are in, and what targets are out.
LOADING 3D MODEL FROM CLOUD
Hi,
I have read many forums on how to load 3d models using metadata flie created on cloud database on Target Manager section and i just cannot get anywhere on how to view a model from a server location.
I have everything setup with model in .assetbundle format (for IOS device) created and URL model path define in the metadata file.
I can see the application detecting the taget information (from the console) coming from the DefaultTrackableEventHandler script assigned to the ImageTarge.
I think the last step is to modify the CloudRecoEventHandler or the SimpleCloudRecoEventHandler which will assign the path coming from the targetSearchResult.MetaData (under OnNewSearchResult class) and link the target to the corresponding 3d model.
Here's the script that i have modify from the SimpleCloudRecoEventHandler sample script.
Can someone help.
Tks,
Rick
using System;
using UnityEngine;
using System.Collections;
/// <summary>
/// This MonoBehaviour implements the Cloud Reco Event handling for this sample.
/// It registers itself at the CloudRecoBehaviour and is notified of new search results.
/// </summary>
public class Simple2CloudRecoEventHandler : MonoBehaviour, ICloudRecoEventHandler
{
#region PRIVATE_MEMBER_VARIABLES
// CloudRecoBehaviour reference to avoid lookups
private CloudRecoBehaviour mCloudRecoBehaviour;
// ImageTracker reference to avoid lookups
private ImageTracker mImageTracker;
private ContentManager mContentManager;
public WWW www;
//private GameObject cube, sphere;
#endregion // PRIVATE_MEMBER_VARIABLES
#region EXPOSED_PUBLIC_VARIABLES
/// <summary>
/// can be set in the Unity inspector to reference a ImageTargetBehaviour that is used for augmentations of new cloud reco results.
/// </summary>
//public ImageTargetBehaviour ImageTargetTemplate;
public ImageTargetBehaviour ImageTargetTemplate;
private string BundleURL;
private string str;
public GUIStyle CustomStyle;
#endregion
#region ICloudRecoEventHandler_IMPLEMENTATION
/// <summary>
/// called when TargetFinder has been initialized successfully
/// </summary>
public void OnInitialized()
{
// get a reference to the Image Tracker, remember it
mImageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);
mContentManager = (ContentManager)FindObjectOfType(typeof(ContentManager));
}
#region UNTIY_MONOBEHAVIOUR_METHODS
/// <summary>
/// register for events at the CloudRecoBehaviour
/// </summary>
void Start()
{
// register this event handler at the cloud reco behaviour
CloudRecoBehaviour cloudRecoBehaviour = GetComponent<CloudRecoBehaviour>();
if (cloudRecoBehaviour)
{
cloudRecoBehaviour.RegisterEventHandler(this);
}
// remember cloudRecoBehaviour for later
mCloudRecoBehaviour = cloudRecoBehaviour;
}
#endregion // UNTIY_MONOBEHAVIOUR_METHODS
#region ICloudRecoEventHandler_IMPLEMENTATION
/// <summary>
/// called when TargetFinder has been initialized successfully
/// </summary>
//public void OnInitialized()
//{
// get a reference to the Image Tracker, remember it
// mImageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);
// mContentManager = (ContentManager)FindObjectOfType(typeof(ContentManager));
//}
/// <summary>
/// visualize initialization errors
/// </summary>
public void OnInitError(TargetFinder.InitState initError)
{
}
/// <summary>
/// visualize update errors
/// </summary>
public void OnUpdateError(TargetFinder.UpdateState updateError)
{
}
/// <summary>
/// when we start scanning, unregister Trackable from the ImageTargetTemplate, then delete all trackables
/// </summary>
public void OnStateChanged(bool scanning)
{
}
/// <summary>
/// Handles new search results
/// </summary>
/// <param name="targetSearchResult"></param>
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
{
// duplicate the referenced image target
GameObject newImageTarget = Instantiate(ImageTargetTemplate.gameObject) as GameObject;
// enable the new result with the same ImageTargetBehaviour:
ImageTargetBehaviour imageTargetBehaviour = mImageTracker.TargetFinder.EnableTracking(targetSearchResult, newImageTarget);
if (imageTargetBehaviour != null)
{
// stop the target finder
mCloudRecoBehaviour.CloudRecoEnabled = false;
//Instantiate(gObject);
// Calls the TargetCreated Method of the SceneManager object to start loading
// the GameObject
mContentManager.TargetCreated(targetSearchResult.MetaData);
}
if(targetSearchResult.MetaData != null ){
BundleURL = targetSearchResult.MetaData;
StartCoroutine(GetAssetBundle());
}
}
#endregion // ICloudRecoEventHandler_IMPLEMENTATION
public void Hide (GameObject obj)
{
Renderer[] rendererComponents = obj.GetComponentsInChildren<Renderer>();
//Disable rendering:
foreach (Renderer component in rendererComponents)
{
component.enabled = false;
}
}
#endregion ICloudRecoEventHandler_IMPLEMENTATION
IEnumerator GetAssetBundle ()
{
//www = new WWW("http://Some Path If Dont Use targetSearchResult.MetaData");
www = new WWW(BundleURL);
yield return www;
AssetBundle bundle = www.assetBundle;
GameObject gObject=Instantiate(bundle.mainAsset,new Vector3(0,0,0),Quaternion.identity) as GameObject;
gObject.transform.localScale=new Vector3(1f,1f,1f);
}
}
Load 3d model through cloud
Thanks for the reply
Indeed i am trying to retreive this information. I am not to confirtable with c#.
I added a GUI.Label at the end of the file but i am not getting anything.
I'll try to confirm shortly.
Thanks
....
....
public void Hide (GameObject obj)
{
Renderer[] rendererComponents = obj.GetComponentsInChildren<Renderer>();
//Disable rendering:
foreach (Renderer component in rendererComponents)
{
component.enabled = false;
}
}
#endregion ICloudRecoEventHandler_IMPLEMENTATION
IEnumerator GetAssetBundle ()
{
//www = new WWW("http://www.simfusion.com/URLAssetBundlesCloud_Ver_4_0/modelipadcloud_300.assetbundle");
www = new WWW(BundleURL);
yield return www;
AssetBundle bundle = www.assetBundle;
GameObject gObject=Instantiate(bundle.mainAsset,new Vector3(0,0,0),Quaternion.identity) as GameObject;
gObject.transform.localScale=new Vector3(50f,50f,50f);
}
public void Update(){
if (BundleURL != null)
{
GUI.Label(new Rect(10, 10, 300, 70), "Path: " + BundleURL.ToString());
}
}
}
Load 3d model through cloud
Hi,
I have been able to see the content of the metadata using Debug.Log (BundleURL);
Metadata value is http://www.server.com/URLAssetBundlesCloud_Ver_4_0/file_name.assetbundle
It gives me the following error
Here's an update of my script called Simple2CloudRecoEventHandler:
using System;
using UnityEngine;
using System.Collections;
/// <summary>
/// This MonoBehaviour implements the Cloud Reco Event handling for this sample.
/// It registers itself at the CloudRecoBehaviour and is notified of new search results.
/// </summary>
public class Simple2CloudRecoEventHandler : MonoBehaviour, ICloudRecoEventHandler
{
#region PRIVATE_MEMBER_VARIABLES
// CloudRecoBehaviour reference to avoid lookups
private CloudRecoBehaviour mCloudRecoBehaviour;
// ImageTracker reference to avoid lookups
private ImageTracker mImageTracker;
//private ContentManager
//mContentManager;
public WWW www;
//private GameObject cube, sphere;
#endregion // PRIVATE_MEMBER_VARIABLES
#region EXPOSED_PUBLIC_VARIABLES
/// <summary>
/// can be set in the Unity inspector to reference a ImageTargetBehaviour that is used for augmentations of new cloud reco results.
/// </summary>
//public ImageTargetBehaviour ImageTargetTemplate;
public ImageTargetBehaviour ImageTargetTemplate;
//private string BundleURL;
//private static string DipslayBundleURL;
public GUIStyle CustomStyle;
#endregion
#region ICloudRecoEventHandler_IMPLEMENTATION
/// <summary>
/// called when TargetFinder has been initialized successfully
/// </summary>
public void OnInitialized()
{
// get a reference to the Image Tracker, remember it
mImageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);
//mContentManager = (ContentManager)FindObjectOfType(typeof(ContentManager));
}
#region UNTIY_MONOBEHAVIOUR_METHODS
/// <summary>
/// register for events at the CloudRecoBehaviour
/// </summary>
void Start()
{
// register this event handler at the cloud reco behaviour
CloudRecoBehaviour cloudRecoBehaviour = GetComponent<CloudRecoBehaviour>();
if (cloudRecoBehaviour)
{
cloudRecoBehaviour.RegisterEventHandler(this);
}
// remember cloudRecoBehaviour for later
mCloudRecoBehaviour = cloudRecoBehaviour;
}
#endregion // UNTIY_MONOBEHAVIOUR_METHODS
#region ICloudRecoEventHandler_IMPLEMENTATION
/// <summary>
/// called when TargetFinder has been initialized successfully
/// </summary>
//public void OnInitialized()
//{
// get a reference to the Image Tracker, remember it
// mImageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);
// //mContentManager = (ContentManager)FindObjectOfType(typeof(ContentManager));
//}
/// <summary>
/// visualize initialization errors
/// </summary>
public void OnInitError(TargetFinder.InitState initError)
{
}
/// <summary>
/// visualize update errors
/// </summary>
public void OnUpdateError(TargetFinder.UpdateState updateError)
{
}
/// <summary>
/// when we start scanning, unregister Trackable from the ImageTargetTemplate, then delete all trackables
/// </summary>
public void OnStateChanged(bool scanning)
{
}
/// <summary>
/// Handles new search results
/// </summary>
/// <param name="targetSearchResult"></param>
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
{
// duplicate the referenced image target
GameObject newImageTarget = Instantiate(ImageTargetTemplate.gameObject) as GameObject;
// enable the new result with the same ImageTargetBehaviour:
ImageTargetBehaviour imageTargetBehaviour = mImageTracker.TargetFinder.EnableTracking(targetSearchResult, newImageTarget);
GameObject augmentation = null;
string BundleURL = targetSearchResult.MetaData;
if (imageTargetBehaviour != null)
{
// stop the target finder
mCloudRecoBehaviour.CloudRecoEnabled = true;
//Instantiate(gObject);
// Calls the TargetCreated Method of the SceneManager object to start loading
// the GameObject
//mContentManager.TargetCreated(targetSearchResult.MetaData);
if(targetSearchResult.MetaData != null ){
//string BundleURL = targetSearchResult.MetaData;
Debug.Log (BundleURL);
StartCoroutine(GetAssetBundle());
}
}
}
#endregion // ICloudRecoEventHandler_IMPLEMENTATION
public void Hide (GameObject obj)
{
Renderer[] rendererComponents = obj.GetComponentsInChildren<Renderer>();
//Disable rendering:
foreach (Renderer component in rendererComponents)
{
component.enabled = false;
}
}
#endregion ICloudRecoEventHandler_IMPLEMENTATION
IEnumerator GetAssetBundle ()
{
www = new WWW("BundleURL");
yield return www;
AssetBundle bundle = www.assetBundle;
GameObject gObject=Instantiate(bundle.mainAsset,new Vector3(0,0,0),Quaternion.identity) as GameObject;
gObject.transform.localScale=new Vector3(50f,50f,50f);
/*
//For Android?
//www = new WWW(BundleURL);
BundleURL = "http://www.server.com/......./file_name.unity3d";
using (WWW www = new WWW(BundleURL)) {
yield return www;
Instantiate(www.assetBundle.mainAsset);
}
*/
}
}
Load 3d model through cloud
Hi,
Yes i have been able to see the content of the metadata using Debug.Log (BundleURL) but it gives me the following error:
The Metadata value is http://www.server.com/URLAssetBundlesCloud_Ver_4_0/file_name.assetbundle
I am using a StartCoroutine fonction from the OnNewSearchResult class and load the 3d model from server in the IEnumerator GetAssetBundle section of the script. Set the script section below with the script in the attachement.
It gives me the following error
...
...
if(targetSearchResult.MetaData != null ){
Debug.Log (BundleURL);
StartCoroutine(GetAssetBundle());
....
....
IEnumerator GetAssetBundle ()
{
www = new WWW("BundleURL");
yield return www;
request = www.assetBundle.LoadAsync("BundleURL", typeof(GameObject));
yield return request;
GameObject qcarObjParent = Instantiate(request.asset, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
GameObject gObject = qcarObjParent.GetComponentInChildren<QCARBehaviour>().gameObject;
StopCoroutine("GetAssetBundle");
}
}
Load 3d model through cloud
What I recommend is to implement a separate script in a language you're familiar w/ (e.g. Javascript ) and to call that from the C# event handler using GetComponent<your_script>().DownloadMethod(), rather than attempt to load from within the event handler.
There is a sample script here that shows how to implement error handling for downloaded asset bundles - http://docs.unity3d.com/Documentation/Manual/DownloadingAssetBundles.html
Load 3d model through cloud
Thank for the reply.
Ok. so if i understand well i would need to build under target image prefab and assign on the asset bundle CachingLoadExemple that will load the url based model. I will need to transfer the BundleURL value.I am still struggling with c# but how do i stranfer the url value to tell the other script wich model to load.
I would execute the the script line from the StartCoroutine of the current SimpleCloudRecoEventHandler script. Is that correct? How would i transfer the BundleURL value and what DoSomething function could be?
GameObject.Find("TargetChildObject").GetComponentInChildren<CachingLoadExemple>().DoSomething();
or
public GameObject TargetChildObject;
TargetChildObject.GetComponentInChildren<CachingLoadExemple>().DoSomething();
Script to stream the asset bundle. Does this srcript load asset with .assetbundle extension. I seem to only work with .unity3D extension This is for IOS.
using System; using UnityEngine; using System.Collections; public class CachingLoadExample : MonoBehaviour { public string BundleURL; public string AssetName; public int version; void Start() { StartCoroutine (DownloadAndCache()); } IEnumerator DownloadAndCache (){ // Wait for the Caching system to be ready while (!Caching.ready) yield return null; // Load the AssetBundle file from Cache if it exists with the same version or download and store it in the cache using(WWW www = WWW.LoadFromCacheOrDownload (BundleURL, version)){ yield return www; if (www.error != null) throw new Exception("WWW download had an error:" + www.error); AssetBundle bundle = www.assetBundle; if (AssetName == "") Instantiate(bundle.mainAsset); else Instantiate(bundle.Load(AssetName)); // Unload the AssetBundles compressed contents to conserve memory bundle.Unload(false); } // memory is freed from the web stream (www.Dispose() gets called implicitly) } }
Load 3d model through cloud
Hi,
I have been able to load the 3d model with recognition cloud. The problem remaining is that it does no desappear when the target is off the camera or when pressing the scan button, it does not reset the scanner. I added a load level application script as a seperate file (with Gui Button) but it does not reset the scanner or application. The loaded model seems to remain in memory (wihout seeing it) not allowing to load new models or the same one.
I guest i would need to do something under OnNewSearchResult class to crreate a condtion when the target is or not in view. I have been looing at all the forums that would cover this issue over the last week. Beside the exemple that we can download from the site an using the ContentManager, there is nothing to tell us anything to solve this issue.
Here's the code so far when loading of asset bundle for IOS.
Can you help?
Rick
using System;
using UnityEngine;
using System.Collections;
public class Simple2CloudRecoEventHandler : MonoBehaviour, ICloudRecoEventHandler
{
#region PRIVATE_MEMBER_VARIABLES
// CloudRecoBehaviour reference to avoid lookups
private CloudRecoBehaviour mCloudRecoBehaviour;
// ImageTracker reference to avoid lookups
private ImageTracker mImageTracker;
//private ContentManager mContentManager;
private WWW www;
private AssetBundleRequest gameObjectRequest;
private string BundleURL;
//For progress bar
private int progress = 0;
private GameObject TempObject;
#endregion // PRIVATE_MEMBER_VARIABLES
#region EXPOSED_PUBLIC_VARIABLES
public ImageTargetBehaviour ImageTargetTemplate;
//For progress bar
public int guiOffset = 20;
public GUIStyle CustomStyle;
#endregion
void Start()
{
// register this event handler at the cloud reco behaviour
CloudRecoBehaviour cloudRecoBehaviour = GetComponent<CloudRecoBehaviour>();
if (cloudRecoBehaviour)
{
cloudRecoBehaviour.RegisterEventHandler(this);
}
// remember cloudRecoBehaviour for later
mCloudRecoBehaviour = cloudRecoBehaviour;
}
#region ICloudRecoEventHandler_IMPLEMENTATION
public void OnInitialized()
{
// get a reference to the Image Tracker, remember it
mImageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);
//mContentManager = (ContentManager)FindObjectOfType(typeof(ContentManager));
}
#region UNTIY_MONOBEHAVIOUR_METHODS
#endregion // UNTIY_MONOBEHAVIOUR_METHODS
#region ICloudRecoEventHandler_IMPLEMENTATION
public void OnInitError(TargetFinder.InitState initError)
{
}
public void OnUpdateError(TargetFinder.UpdateState updateError)
{
}
public void OnStateChanged(bool scanning)
{
if (scanning)
{
// clear all known trackables
mImageTracker.TargetFinder.ClearTrackables(false);
// hide the ImageTargetTemplate
//mContentManager.HideObject();
}
}
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
{
// duplicate the referenced image target
GameObject newImageTarget = Instantiate(ImageTargetTemplate.gameObject) as GameObject;
GameObject augmentation = null;
if( augmentation != null )
augmentation.transform.parent = newImageTarget.transform;
// enable the new result with the same ImageTargetBehaviour:
ImageTargetBehaviour imageTargetBehaviour = mImageTracker.TargetFinder.EnableTracking(targetSearchResult, newImageTarget);
//StartCoroutine(GetAssetBundle());
Debug.Log("Metadata value is " + BundleURL );
if (imageTargetBehaviour != null)
{
// stop the target finder
mCloudRecoBehaviour.CloudRecoEnabled = false;
if (targetSearchResult.MetaData != null)
{
BundleURL = targetSearchResult.MetaData;
StartCoroutine(GetAssetBundle());
}
}
}
#endregion // ICloudRecoEventHandler_IMPLEMENTATION
/*
public void Hide (GameObject obj)
{
Renderer[] rendererComponents = obj.GetComponentsInChildren<Renderer>();
//Disable rendering:
foreach (Renderer component in rendererComponents)
{
component.enabled = false;
}
}
*/
private void Hide( GameObject model ){
Debug.Log( "Hiding "+ model.name );
Renderer[] rendererComponents = model.GetComponentsInChildren<Renderer>();
Collider[] colliderComponents = model.GetComponentsInChildren<Collider>();
// Disable rendering:
foreach (Renderer component in rendererComponents)
{
component.enabled = false;
}
// Disable colliders:
foreach (Collider component in colliderComponents)
{
component.enabled = false;
}
//Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " lost");
}
//}
#endregion ICloudRecoEventHandler_IMPLEMENTATION
IEnumerator GetAssetBundle ()
{
www = new WWW(BundleURL);
yield return www;
Debug.Log("The last BundleURL " + BundleURL );
AssetBundleRequest request = www.assetBundle.LoadAsync("modelipad", typeof(GameObject));
yield return request;
Instantiate(request.asset, new Vector3(0f, 0f, 0f), Quaternion.identity);
//Put the stream model under the image target
GameObject ImageTargetUsed = GameObject.Find("CloudRecoTarget");
GameObject ModelIpadClone = GameObject.Find("modelipad(Clone)");
ModelIpadClone.transform.parent = ImageTargetUsed.transform;
}
// Update is called once per frame
void OnGUI(){
GUILayout.Space(guiOffset);
progress = (int)(www.progress * 100);
GUILayout.BeginArea(new Rect(Screen.width / 2, 20,200,50));
GUILayout.Label( progress + "%",CustomStyle);
GUILayout.EndArea();
}
}
Load 3d model through cloud
Hi binspaul,
We've been able to correct the issue with some work in modilying the structure of the script.
With the help of an experience programmer, we've been able to create a solution that would support ios and android platform where we can stream our 3d content from any servers with the use our metadata file.
Since it been a while since we fixed the issue, i will look into the new sdk.
Thanks
Rick
Load 3d model through cloud
Hi,
Thanks for the reply. I am also working in the similar line to load 3D models dynamically from the server. I am using the 'monkey.obj model for testing. When using the Unity AssetBundle code, the response obtained is:
1. The cloud recognition meta url is obtained correctly (The last BundleURL is: http://www.domain.com/streaming/Model.obj)
2. I am getting the progressbar updated to 100%.
3. No model is displayed. I think there is something to be done with the script or model.
---
Also, I would like to know your feedback/suggestion on the following:
-> What all file types are currently supported?
-> How did you assign the texture to the model? Is the texture baked inside the model?
Thanks,
BP
Load 3d model through cloud
Hii..
I just started to do stuff in unity...I am newbie in this unity Gaming world..
I am doing dynamic 3d model using Cloud Reco...and I am able to get Metadata when Image is scanned ..Metadata as URL from where I can download 3d model..
But I am getting error..which I am not able to interpret it ....
could Anyone please help out it...
Error in this line -->
AssetBundleRequest request = www.assetBundle.LoadAssetAsync("ImageTarget", typeof(GameObject));
Error -->
NullReferenceException: Object reference not set to an instance of an object
SimpleCloudHandler+<GetAssetBundle>c__Iterator0.MoveNext () (at Assets/SimpleCloudHandler.cs:150)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
Search the forums for "asset bundles" and also read the docs over at Unity to see how this works.
Note this is a pro only feature.
N