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


  • 相关阅读:
    Windows远程桌面连接CentOS 7
    CentOS7 系统菜单中添加快捷方式
    CentOS 7 创建桌面快捷方式
    Centos7 可执行程序自定义为系统服务
    CentOS 7 中 Docker 的安装
    CentOS 7 需要安装的常用工具,及centos安装fcitx 搜狗输入法的坑旅
    C++中结构体与类的区别 2
    C++中结构体与类的区别 1
    C++ 11 自旋锁
    Imply.io单机安装
  • 原文地址:https://www.cnblogs.com/niconico/p/5009294.html
Copyright © 2020-2023  润新知