The 3D model is supported in cesium, but only the GLTF format is supported. GLTF is an Exchange format defined by the Khronos organization (the one that drafted the OpenGL standard) for displaying 3d content on the Internet or on mobile devices, fully supporting the Opengl,webgl,opengles graphics acceleration standard.
GLTF can now be converted from the Collada format, and a conversion tool (HTTPS://WWW.KHRONOS.ORG/GLTF) is also available on the official website. This tool compared to the pit father, only and Collada files in the same directory to work, the converted result file must also be in the same directory, that is, can not specify the input and output path, the pit of my long time to find.
A Collada file is converted to 4 files, one. Bin, one. JSON, two. GLSL. json files are descriptive files,. bin is the actual data, and two GLSL files are vertex-shaded language files. Deploy the directories on the Web server to which the files reside. Add on client Side
var ellipsoid = viewer.scene.globe.ellipsoid;var cart3 = Ellipsoid.cartographictocartesian (Cesium.Cartographic.fromDegrees (lng, lat, height));var Modelmatrix = cesium.transforms.eastnorthuptofixedframe (CART3);var quat = Cesium.Quaternion.fromAxisAngle (Cesium.cartesian3.unit_z, cesium.math.toradians (rotate - 90)); Var mat3 = cesium.matrix3.fromquaternion (Quat);var mat4 = Cesium.Matrix4.fromRotationTranslation (Mat3, cesium.cartesian3.zero);var m = Cesium.Matrix4.multiplyTransformation (MODELMATRIX, MAT4);//Obtain the final transformation matrix, referring to the author's previous written "Coordinate transformation" chapter var model = viewer.scene.primitives.add (CESIUM.MODEL.FROMGLTF ({url : ' Http://localhost:88/gltf/tower.json ' ,///conversion of 4 files in the JSON file modelmatrix : m, //add the Model transformation matrix, in order to display in the correct position, otherwise killed can not find, is placed in a corner of the Earth scale:1.0 // magnification}));//After the model is loaded, play Model.readyToRender.addEventListener (model)  {//&NB If there is an animationSp Play and loop all animations at half-speadmodel.activeanimations.addall ({speedup : 0.5,loop : cesium.modelanimationloop.repeat});
Effects after loading a model
The model shows whether the smoothness is closely related to the number of triangular faces of the model, machine configuration, and browser version. Browsers recommend using Chrome30.0 above.
This is the end of this article