最近在三维开发,用su2016导出了dae文件,并用supermap生成了smwu文件,用supermap打开后确认可以正常显示,但在开发过程中,我写了如下将文件读取并以默认方式打开的代码,但每次执行程序后发现,并没有定位到我所建立的模型位置,我用camera类设置了相关经纬度和相机高度参数,但发现并没有用,运行后只显示一个地球全景,如图,请问是我代码有问题么?
//连接文件写在LoadData类中
private void Initialize()
{
WorkspaceConnectionInfo wsConn = new WorkspaceConnectionInfo(@"..\test5\data\BJFUcj.smwu");
myworkspace.Open(wsConn);
myscenecontrol1.Action = Action3D.Pan;
myscenecontrol1.Scene.Refresh();
Flyto();
}
public void Flyto()
{
Camera camera = myscenecontrol1.Scene.Camera;
camera.Altitude = 20;
camera.Latitude = 36;
camera.Longitude = 109;
camera.Tilt =20;
myscenecontrol1.Scene.Fly(camera, 1);
}
//mainform中显示
public Form1()
{
InitializeComponent();
InitSkinGallery();
SuperMap.Data.Environment.IsSceneAntialias = true;
SuperMap.Data.Environment.SceneAntialiasValue = 4;
this.mywoksp = new SuperMap.Data.Workspace(this .components );
this.myscenecl =new SuperMap .UI .SceneControl ();
this.myscenecl.Dock = DockStyle.Fill;
this.splitContainerControl.Panel2.Controls.Add(myscenecl );
myloaddtad = new LoadData(mywoksp ,myscenecl );