we are loading the 3d model (glb) using cesium .These models are provided by our clients.
When are loading these models are rendering in different coordinates.
Even when i specify particular location using modelMatrix.
Attached sample file for your reference
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
viewer.extend(Cesium.viewerCesiumInspectorMixin);
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 0.0));
var model = scene.primitives.add(Cesium.Model.fromGltf({
url : '/assets/jayanagar.glb',
modelMatrix : modelMatrix,
scale : 200.0
}));
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
My client wants to load 3d models with shops images
4. The Cesium version you're using, your operating system and browser.
latest version , using chrome browser
Thanks for the response.
Here is my full code.
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://cesiumjs.org/releases/1.58/Build/Cesium/Cesium.js"></script>
<link href="https://cesiumjs.org/releases/1.58/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
</head>
<body>
<div id="cesiumContainer" style="width: 700px; height:400px"></div>
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYTIxNzIxNC05MTU4LTRkMzYtYTk4My1jZjY2YWU1NzAwOTYiLCJpZCI6MTE1NjYsInNjb3BlcyI6WyJhc2wiLCJhc3IiLCJhc3ciLCJnYyJdLCJpYXQiOjE1NTkyMjY3OTR9.DbPDfD1Nnb9dDigvG6uh_qmF-FHhIcZNhKTfiJAXha4';
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
// viewer.extend(Cesium.viewerCesiumInspectorMixin);
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 0.0));
var model = scene.primitives.add(Cesium.Model.fromGltf({
url : '/assets/jayanagar.glb',
modelMatrix : modelMatrix,
scale : 200.0
}));
</script>
</body>
</html>
I followed this link
https://cesium.com/docs/tutorials/3d-models/
Yes the 3d model is loading few metres off.