object.net 9d中,我将sgm加载到kml图层(示例代码如下),我通过修改GeoModel.RotationZ是可以实现沿Z轴旋转,但是我想问下组件中有没有像在idesktop可编辑状态下那样,可以选中一个模型,然后出现沿Z轴方向旋转的箭头,用户可以任意旋转模型。还是要自己写代码实现?
private void AddFeature(int smID,string modelFilePath, double RotationZ, GeoPoint3D position)
{
GeoPlacemark geoPlacemark = new GeoPlacemark();
var geoModel = new GeoModel();
geoModel.FromFile(modelFilePath);
//人物模型朝向前进方向,如果原始方向一致则不需要旋转。
geoModel.RotationZ = RotationZ;
geoModel.Position = new Point3D { X = position.X, Y = position.Y, Z = position.Z };
GeoStyle3D geoStyle3D = new GeoStyle3D();
geoStyle3D.AltitudeMode = AltitudeMode.Absolute;
geoModel.Style3D = geoStyle3D;
geoPlacemark.Geometry = geoModel;
Feature3Ds feture3Ds = m_layerKML.Features;
Feature3D feature = new Feature3D();
feature.Name = smID.ToString();//记录smID
feature.Geometry = geoPlacemark;
feature.Description = Path.GetFileNameWithoutExtension(modelFilePath);
//feature.Name = feature.Description;
feture3Ds.Add(feature);
feture3Ds.ToKMLFile(m_layerKML.DataName);
}