Thanks for your answer.
The problem is that i've based my code from your blog "An Introduction to Cesium Android Apps with Cordova" but i didn't work. By the way, the code that i've post juste upper in my first message come from there.
That's why i've asked the question on the forum ;)
Yohann
var heightOffsetB1B2=15.8
var longOffsetB1B2 = 0.00000091;
var latOffsetB1B2=0.00000035;
var uri =this.result;
viewer.entities.add({
url : uri,
position :Cesium.Cartesian3.fromDegrees (4.33763, 50.69359,20),
billboard : {
image : pinBuilder.fromText('test', Cesium.Color.RED, 48),
verticalOrigin : Cesium.VerticalOrigin.BOTTOM
}
});
or it doesn't supported primtives and 3DCesiumTiles.
var tileset = new Cesium.Cesium3DTileset({ url : url });var boundingSphere = tileset.boundingSphere;
viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0, -2.0, 0));
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
// Position tileset
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude,cartographic.height);
var cartographic_longitude= cartographic.longitude -longOffsetr3;
var cartographic_latitude= cartographic.latitude -latOffsetr3;
var offset = Cesium.Cartesian3.fromRadians(cartographic_longitude, cartographic_latitude, heightOffsetr3);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
console.log(tileset.modelMatrix); I've removed the block as you wrote upper. I have a silent failure when i want to load json files...
With android studio, i've found that this error: "Uncaught TypeError: Cesium.Cesium3DTileset is not a constructor".
Have you already heared about it?
With the 1.43 version, i don't have the same problem. Here it is:
03-28 16:22:39.529 13896-13896/io.cordova.hellocordova D/SystemWebChromeClient: file:///android_asset/www/index.html: Line 1439 : [object Object]
03-28 16:22:39.529 13896-13896/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(1439)] "[object Object]", source: file:///android_asset/www/index.html (1439)
03-28 16:22:39.557 13896-13896/io.cordova.hellocordova D/SystemWebChromeClient: file:///android_asset/www/Cesium/Cesium.js: Line 531 : A 3D tile failed to load: data:Data/Tile_p014_p004/Tile_p014_p004.json
03-28 16:22:39.557 13896-13896/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(531)] "A 3D tile failed to load: data:Data/Tile_p014_p004/Tile_p014_p004.json", source: file:///android_asset/www/Cesium/Cesium.js (531)
03-28 16:22:39.558 13896-13896/io.cordova.hellocordova D/SystemWebChromeClient: file:///android_asset/www/Cesium/Cesium.js: Line 531 : Error: Request has failed.
03-28 16:22:39.558 13896-13896/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(531)] "Error: Request has failed.", source: file:///android_asset/www/Cesium/Cesium.js (531)
03-28 16:22:39.558 13896-13896/io.cordova.hellocordova D/SystemWebChromeClient: file:///android_asset/www/Cesium/Cesium.js: Line 531 : A 3D tile failed to load: data:Data/Tile_p015_p004/Tile_p015_p004.json
03-28 16:22:39.558 13896-13896/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(531)] "A 3D tile failed to load: data:Data/Tile_p015_p004/Tile_p015_p004.json", source: file:///android_asset/www/Cesium/Cesium.js (531)
03-28 16:22:39.559 13896-13896/io.cordova.hellocordova D/SystemWebChromeClient: file:///android_asset/www/Cesium/Cesium.js: Line 531 : Error: Request has failed.
03-28 16:22:39.559 13896-13896/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(531)] "Error: Request has failed.", source: file:///android_asset/www/Cesium/Cesium.js (531)
03-28 16:22:39.559 13896-13896/io.cordova.hellocordova D/SystemWebChromeClient: file:///android_asset/www/Cesium/Cesium.js: Line 531 : A 3D tile failed to load: data:Data/Tile_p014_p007/Tile_p014_p007.json
03-28 16:22:39.559 13896-13896/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(531)] "A 3D tile failed to load: data:Data/Tile_p014_p007/Tile_p014_p007.json", source: file:///android_asset/www/Cesium/Cesium.js (531)
03-28 16:22:39.560 13896-13896/io.cordova.hellocordova D/SystemWebChromeClient: file:///android_asset/www/Cesium/Cesium.js: Line 531 : Error: Request has failed.
03-28 16:22:39.560 13896-13896/io.cordova.hellocordova I/chromium: [INFO:CONSOLE(531)] "Error: Request has failed.", source: file:///android_asset/www/Cesium/Cesium.js (531)
I don't have any idea of what this means ( except it didn't load.. lol).
Thanks for the answer.
Yes i'm in accord with you. Seems to have a problem to load the 3D json file.
However, the "load" manner that i used is the same then the one to upload 3D tile with Cesium on Firefox. It's a bit strange..
Do you (or anyone else of your team) know a way (which supposed to work) to import 3D tile? Using another file extension perhaps? (or convert JSON in gltf maybe?)
Greetings,
Yohann
Thanks for the answer. I've looked but there is no great change with the server.js that i've used. It seems to have some more tileset file format accepted.
The rest is identical :/ I think it won't change the import of 3D tiles on mobile, but i gonna try.
Greetings,
Yohann