提交 2e9e5e97 编写于 作者: antony sun's avatar antony sun

单个批处理模型创建

上级 71ab05b6
using System;
using System.Collections.Generic;
using System.Text;
namespace Cesium3DTiles
{
public class BatchedModelCreateOption
{
// for output
public string TileModelName { get; set; }
public string GltfName { get; set; }
public float Scale { get; set; }
public bool EastNorthUp { get; set; }
public bool UseOrientation { get; set; }
public bool UseRelativePosition { get; set; } = true;
public double[] RtcCenter { get; set; }
public bool UniformScale { get; set; } = true;
}
}
......@@ -16,7 +16,33 @@ namespace Cesium3DTiles
public class ModelBuilder
{
#region Batched 3D Model
//e.g.
//BatchedModelInfo<int> model = new BatchedModelInfo<int>()
//{
// Id = 0,
// Name = "name",
// Longitude = -1.31968,
// Latitude = 0.698874,
// Heading = 6.155801922082901,
// Properties = new Dictionary<string, object>()
// {
// { "name", "building0" },
// { "year", 10 }
// }
//};
public static void CreateBatched3DModel(BatchedModelCreateOption option, BatchedModelInfo<int> model)
{
var tileModel = new TileModel(option.TileModelName, option.GltfName);
var batchedModel = tileModel.CreateBatched3DModel();
var ellipsoid = Ellipsoid.WGS84;
if (option.UseRelativePosition)
batchedModel.RtcCenter = option.RtcCenter;
batchedModel.AddBatchModel(model, option.GltfName);
tileModel.Save();
}
#endregion
#region Instanced 3D Model
//创建一组智能杆的3D Tiles文件,需要按智能杆类型创建
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册