Hi Chris,
any help appreciated.
Chris
The glTF doesn't have the longitude and latitude exactly, but in some cases it may have a 4x4 matrix that transform it.(like in option 2 above) . Really the best place to get the longitude and latitude would be from the tileset.json, which defines the bounding volumes. Many of the example tilesets will have a boundingVolume.region property that gives you the [west longitude, south latitude, east longitude, north latitude, minHeight, maxHeight], which you can easily get the center longitude and latitude from.
var centerLatitude = 0.698874;
var centerLongitude = -1.31968;
var dragonWidth = 14.191;
var dragonHeight = 10.075;
var dragonDepth = 6.281;
var dragonBox = [0.0, 0.0, 0.0, dragonWidth, 0.0, 0.0, 0.0, dragonDepth, 0.0, 0.0, 0.0, dragonHeight];
// this line above swaps from y-up to z-up, but there will be a change in Cesium soon for all local bounding volumes to stay y-up
var dragonScale = 100.0;
var dragonOffset = dragonHeight / 2.0 * dragonScale;
var dragonCartesian = Cartesian3.fromRadians(centerLongitude, centerLatitude, dragonOffset);
var scaleMatrix = Matrix4.fromUniformScale(dragonScale);
var wgs84Matrix = Transforms.headingPitchRollToFixedFrame(dragonCartesian, 0.0, 0.0, 0.0);
var dragonMatrix = Matrix4.multiply(wgs84Matrix, scaleMatrix, new Matrix4());
var dragonTransform = new Array(16);
Matrix4.pack(dragonMatrix, dragonTransform);
Hi Sean, I'm now trying to figure out batch table. But I don't know how to add batchID to the glTF.
Hi Sean, I'm now trying to figure out batch table. But I don't know how to add batchID to the glTF.
Hi Sean, I'm now trying to figure out batch table. But I don't know how to add batchID to the glTF.
Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(lon,lat,0))
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/qMKvqBUGsoE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.