Cesium Js without cesium ion

Hello,

I am trying to use cesium js to view 3D objects like buildings and vehicles. I do not want to use cesium ion as it is not open source. Please guide me on how can I use cesiumJs in stand alone or with a different platform which is open source.

Since I am new to Cesium I also wanted to understand if viewer is part of cesium ion or cesium js?

Thank you for your help in advance.

1 Like

Hi,
Im not a pro with Cesium but you can create a Cesium.viewer in javascript and drop in assets which are hosted through Cesium ion using the asset ID. Cesium.IonResource.fromAssetId(########)
This is handy because your asset is already loaded to the web on Cesium ion and all that has to happen now is cesium viewer just has to render it to your browser.

Thank you for your reply.

We are not planning to use cesium ion at this moment. Hence was exploring other imagery provider such as Open Street maps and some open source terrain providers. Anyways thank you for your reply.

Im not sure how much you know but using the following code will build you an instance of Cesium viewer and add the world as well as OSM. You obviously need to use your default access token and import Cesium frameworks therefore bypassing ion.

const viewer = new Cesium.Viewer("cesiumContainer", {
  terrain: Cesium.Terrain.fromWorldTerrain(),
});

const osmBuildingsTileset = await Cesium.createOsmBuildingsAsync();
viewer.scene.primitives.add(osmBuildingsTileset);

viewer.scene.camera.flyTo({
  destination: Cesium.Cartesian3.fromDegrees(-74.019, 40.6912, 750),
  orientation: {
    heading: Cesium.Math.toRadians(20),
    pitch: Cesium.Math.toRadians(-20),
  },
}); 

Take a look at the live examples to get you started.

Thank you for your response.

I see that Cesium.Terrain is an object of cesium ion. Currently I am trying to import data from the local system into cesium js but found no luck there. I also tried to use some online links to get 3d model data onto my application but found no luck there.

Is there any way to load 3d models or tiles into the application from local files?

Yest it is possible if you use the 3D tiles format. The file tileset.json is local.

    var $3dTilesLayerBuilding02 = new itowns.C3DTilesLayer('Building02', {
        name: 'Building02',
        sseThreshold: 0.05,
        source: new itowns.C3DTilesSource({
            url: './O02_2016_b3dm_4326_jpeg_ortho/Building/tileset.json',
        }),
    }, view);

The Cesium platform follows an open-core business model with open source runtime engines such as CesiumJS and optional commercial subscription to Cesium ion.

CesiumJS can stream open standards from other offline or online services. We provide Cesium ion as the quickest option for all users to get up and running, but you are free to use any combination of content sources with CesiumJS that you please.

Our Offline Guide can get you started, and it should be fairly straightforward to sub in other URLs as needed. If you need help with a specific type of data like imagery, terrain, or 3D Tilesets, just let us know.

Thank you for your response.

It helped me with getting started with Cesium.

I am trying to load Las files into cesium viewer. Since the las files has to be converted to either 3D-Tiles or gltf format. I do not want to use Ion to do this.

I am looking for some opensource converter which can convert point clouds (Las files) to 3D-Tiles or glTF files. Preferably on Js. Any other converters are also file for me. Please help me on how I can load Las files.

Thanks in advance.

Hi @yadu66, glad that information helped!

Cesium ion and our las to 3D Tiles tools are not open source. However, since 3D Tiles iteself is an open standard, you may be able to find another non-Cesium converter. Perhaps some other members of the community here will be able to recommend one,

Thanks!

Thank you,

I would appreciate if anyone can help me finding any non-cesium or third party libraries to convert from las to 3D-tiles/glTF formats.

There’s lots available, but I’m assuming you mean free and / or open-source?

yes correct

Perhaps itowns or vts geospatial would help. https://vts-geospatial.org/
https://www.itowns-project.org/