Form1.cs
上传用户:lslight
上传日期:2022-01-10
资源大小:14248k
文件大小:3k
- ////////////////////////////////////////////////////////////////////////
- // ■■■■ ■■■■■ ■■■■ ■ ■ //
- // ■ ■ ■ ■ ■ //
- // ■ ■ ■ ■■■ ■ ■ //
- // ■ ■ ■ ■ ■ ■ //
- // ■■■■ ■ ■■■■ ■■■■ //
- // Copyright (c) 三峡大学水利与环境学院 肖泽云. All rights reserved. //
- ////////////////////////////////////////////////////////////////////////
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace 三维控件测试程序
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- //指定地形图的高度图路径
- xSceneControl1.heightMapPath = Application.StartupPath + "\heightMap.BMP";
- //指定地形贴图
- xSceneControl1.texturePath = Application.StartupPath + "\colorMap.jpg";
- xSceneControl1.InitializeDirect3D();
- xSceneControl1.Render();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- string heightMapPath = Application.StartupPath + "\heightMap.BMP";
- //指定地形贴图
- string texturePath = Application.StartupPath + "\colorMap.jpg";
-
- xSceneControl1.BuildTerrain(heightMapPath, texturePath);
- /*
- xSceneControl1.heightMapPath = @"G:MusicTerrainViewer_14TerrainViewermapssthelens257.png";
- xSceneControl1.texturePath = xSceneControl1.heightMapPath;
- xSceneControl1.InitializeDirect3D();
- xSceneControl1.Render();
- */
- }
- private void lastViewButton_Click(object sender, EventArgs e)
- {
- xSceneControl1.LastScene();
- }
- private void nextSceneButton_Click(object sender, EventArgs e)
- {
- xSceneControl1.NextScene();
- }
- private void topViewButton_Click(object sender, EventArgs e)
- {
- xSceneControl1.TopView();
- }
- private void leftViewButton_Click(object sender, EventArgs e)
- {
- xSceneControl1.LeftView();
- }
- private void frontViewButton_Click(object sender, EventArgs e)
- {
- xSceneControl1.FrontView();
- }
- }
- }