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);


 

转载于:https://www.cnblogs.com/niconico/p/5009294.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值