示例#1
0
        /// <summary>
        /// when converted, generate tileset
        /// </summary>
        /// <param name="objFile">obj file path</param>
        /// <param name="outputPath">output folder</param>
        /// <param name="gisPosition">where the obj model positioned</param>
        /// <returns></returns>
        internal static SingleTileset WriteTileset(string objFile, string outputPath, GisPosition gisPosition)
        {
            var fileName       = Path.GetFileNameWithoutExtension(objFile);
            var b3dmFile       = Path.Combine(outputPath, fileName + ".b3dm");
            var tilesetOptions = WriteB3dm(objFile, b3dmFile);

            //tilesetOptions.TransHeight = 0;
            //tilesetOptions.MinHeight = 0;
            //tilesetOptions.MaxHeight = 40;
            //tilesetOptions.TileWidth = 200;
            //tilesetOptions.TileHeight = 200;
            tilesetOptions.SetPosition(gisPosition);
            tilesetOptions.UseRegion = true;
            var singleTileset = SingleTileset.Create(tilesetOptions);

            return(singleTileset);
        }
示例#2
0
        internal static SingleTileset WriteTileset(ObjModel objModel,
                                                   string objFolder, string outputPath, GisPosition gisPosition)
        {
            var modelName = objModel.Name;
            var b3dmFile  = Path.Combine(outputPath, modelName + ".b3dm");
            var converter = new Converter(objModel, objFolder,
                                          new GltfOptions {
                Binary = true, Name = modelName, WithBatchTable = true
            });
            var tilesetOptions = WriteB3dm(converter, b3dmFile);

            //tilesetOptions.TransHeight = 0;
            //tilesetOptions.MinHeight = 0;
            //tilesetOptions.MaxHeight = 40;
            //tilesetOptions.TileWidth = 200;
            //tilesetOptions.TileHeight = 200;
            tilesetOptions.SetPosition(gisPosition);
            tilesetOptions.UseRegion = true;
            var singleTileset = SingleTileset.Create(tilesetOptions);

            return(singleTileset);
        }