Start a new topic

Xamarin 3D Model not works

Xamarin 3D Model not works


Hello,

I'm developing in Xamarin Studio and application for Android devices.

I use the same code as the example.

If i use the car.wt3 provided by the sample app all works fine, but if i use my own model it doesn't work. I generated my model using the Wikitude 3D Encoder from an original fbx file created using Blender.

In Wikitude 3d Encoder i can see my model correctly.

 

I tested your wt3. It renders fine in the newest version of the WikitudeSDK (5.1.3) which will be released shortly. 

Thank you,

When this version of the SDK will be released for Xamarin?

And how can i render my model with the 5.1.1? There is any kind of walkaround?

I've tryied with other versions of SDK (5.0.0 and 4) and the model still not render.

Is there a specific encoder for the 5.1.1? I'm really in trouble with this issue...

Unfortunately there is not yet a date set for releasing SDK 5.1.3 for Xamarin.

Please send us your model (fbx). Maybe there is a workaround.

Hello,

I've attached an archive with 2 fbx models for testing them. In the application there will be about 20 different models.

 

Any news??

I converted your FBX with the Wikitude3dEncoder 1.2 (see attachments) and tested it with the SDK 5.1.0 on Xamarin with iPhone 5 and it rendered correctly.

Which device are you using?

Is there any error message on the console?

I tested the 2 models,

They render perfectly on Samsung S6Edge (Android 5.1) and S4mini (Android 4.4.2), but with Huawei P8Lite (Android 5.1) still don't work. In that phone i can see only the car.wt3 provided by the example.

I'm working with SDK 5.1.1 version and in console logs there aren't errors.

Glad to hear that.

Can you give these two wt3 files a trial?

I tested the file you had attached and they work as the revious, good on Samsung devices and they not renders on Huawei devices. (but in this moment it is passable)

Now i have an other question, how can i switch between different models?

My code is the same, but i have always the previous model drawed on screen, when i switch (for switching i'm calling init function with different parameters).

And i had to move the phone and then target again the marker to show the selected model, how can render different 3d model without moving phone from the target?

var pageOne = null;
var tracker = null;
var modelsArray = null;
var World = {
loaded: false,
init: function initFn(toShow) {
this.createOverlays(toShow);
},

createOverlays: function createOverlaysFn(toShow) {

var variant = jQuery("#variant").val();
var colorType = jQuery("#color_type").val();

tracker = new AR.ClientTracker("assets/magazine.wtc");

modelsArray = ;

jQuery("#tk_door").empty();
jQuery("#tk_door").append(toShow);

for(var k = 0; k < modelsGlobal.length; k++)
{
var tmpModel = new AR.Model("assets/"+modelsGlobal+".wt3", {
scale: {
x: 0.2,
y: 0.2,
z: 0.2
},
translate: {
x: 0.0,
y: 0.05,
z: 0.0
},
rotate: {
roll: 180
}
});

modelsArray.push(tmpModel);

if(k == toShow)
modelsArray.enabled = true;
else
modelsArray.enabled = false;
}



pageOne = new AR.Trackable2DObject(tracker, "*", {
drawables: {
cam: modelsArray
}
});
},

worldLoaded: function worldLoadedFn() {

}
};

World.init(0);

 

I tested your use case with the following code sample, which worked out fine, toggling between the models when clicking them while keeping the same target: 

    

    this.model1 = new AR.Model("assets/model1.wt3");

    this.model1.enabled = false;

    

    this.model2 = new AR.Model("assets/model2.wt3");

    this.model2.enabled = true;

 

    this.model1.onClick = function( drawable, model_part ) {

                                World.model1.enabled = false;

                                World.model2.enabled = true;

                            }

    

    this.model2.onClick = function( drawable, model_part ) {

                            World.model2.enabled = false;

                                World.model1.enabled = true;

                            }

    

    var trackable = new AR.Trackable2DObject(this.tracker, "*", {

                                                 drawables: { cam:  }

                                             });

Thank you, with this sample i have solved the issue.

Now all works fine. But i still have a question, why on my Huawei phone the augmented reality don't show up? It's a 2015 device

Which Huawei model?

The camera image is visible?

Do the SDK samples work on this device? That is, are the samples working, which do not use 3D model augmentations, but image or video drawables? 

Is there any error message or does the app's log give a hint what's going wrong?
Login or Signup to post a comment