Axiom3D学习日记 4.地形,天空,雾

首先需要引用Axiom.SceneManagers.Octree.dll.

地形:

载入地形配置,从一个文件中.

scene.LoadWorldGeometry( "Terrain.xml" );

如果报找不到地形文件的错误,可能是因为,你的地形载入代码在scene = Root.Instance.CreateSceneManager(SceneType.ExteriorClose);之前.

因为在scene = Root.Instance.CreateSceneManager(SceneType.ExteriorClose);之后,引擎才会载入资源.

 

Terrain.xml

 

关于该文件详细信息,请看这 [here].

TerrainSceneManager用高度图来生成地形,你可以指定高度图通过Heightmap.image属性, 你可以设置WorldTexture贴图属性, 还允许你指定 "DetailTexture"属性,

 

它让地形纹理看起来更有细节,所有这些参数都在terrain.xml设定.

 

天空:

SkyBox(天空盒)

scene.SetSkyBox(true, "Examples/SpaceSkyBox", 1000);

1:是否启用

2:材质名字

3:与相机距离

 

Sky Domes(天空球)

 

scene.SetSkyDome( true, "Examples/CloudySky", 5, 8 );

3:曲率,范围:2-65

4:贴图重复次数.

Sky Planes

Plane plane = new Plane();
plane.D = 1000; //Set distance as 1000
plane.Normal = Vector3.NegativeUnitY; //Make the texture face down
scene.SetSkyPlane(true, plane, "Examples/SpaceSkyPlane");

Fog

线性雾

ColorEx fadeColor = ColorEx.WhiteSmoke; 
viewport.BackgroundColor = fadeColor;
scene.SetFog(FogMode.Linear, fadeColor, 0, 50, 50);

scene.SetFog(FogMode.Exp, fadeColor, 0.005f);

scene.SetFog(FogMode.Exp2, fadeColor, 0.003f);


 

posted @ 2015-12-01 10:17  NNiiccoo  阅读(239)  评论(0编辑  收藏  举报

去Yes