Axiom3D学习日记 1.程序配置

1.需要引用的库

  • Axiom
  • Axiom.Framework
  • Axiom.Platforms.Win32
  • Axiom.Plugins.FreeImageCodecs
  • Axiom.Plugins.ParticleFX
  • Axiom.RenderSystems.Xna OR Axiom.RenderSystems.OpenGL.OpenTK OR Axiom.RenderSystems.DirectX9

还要复制使用的底层DLL到程序目录.freeimage.dll zlib1.dll

2.如果使用的是VS2010和.net4.0,需要在App.config文件里的<configuration />节点内写入配置信息..

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

3.引用这些命名空间

using Axiom.Core;
using Axiom.Graphics;
using Axiom.Math;
using Axiom.Framework.Configuration;

4.复制这些代码,运行.

IConfigurationManager ConfigurationManager = ConfigurationManagerFactory.CreateDefault();
using ( var root = new Root( "Game1.log" ) )
{
    if ( ConfigurationManager.ShowConfigDialog( root ) )
    {
        RenderWindow window = root.Initialize( true );

        ResourceGroupManager.Instance.AddResourceLocation( "media", "Folder", true );

        SceneManager scene = root.CreateSceneManager( SceneType.Generic );
        Camera camera = scene.CreateCamera( "cam1" );
        Viewport viewport = window.AddViewport( camera );

        TextureManager.Instance.DefaultMipmapCount = 5;
        ResourceGroupManager.Instance.InitializeAllResourceGroups();

        Entity penguin = scene.CreateEntity( "bob", "penguin.mesh" );
        SceneNode penguinNode = scene.RootSceneNode.CreateChildSceneNode();
        penguinNode.AttachObject( penguin );

        camera.Move( new Vector3( 0, 0, 300 ) );
        camera.LookAt( penguin.BoundingBox.Center );
        root.RenderOneFrame();
    }
    Console.Write( "Press [Enter] to exit." );
    Console.ReadLine();
}

 

posted @ 2015-11-30 15:32  NNiiccoo  阅读(256)  评论(0编辑  收藏  举报

去Yes