码迷,mamicode.com
首页 > 其他好文 > 详细

Axiom3D学习日记 0.Axiom基础知识

时间:2015-11-30 18:02:29      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:

程序基本步骤:

  1. Create the Root object.
  2. Define the resources that the application will use.
  3. Choose and set up the render system (that is, DirectX, OpenGL, etc).
  4. Create the render window (the window which Axiom will render onto).
  5. Initialize the resources that you are going to use.
  6. Create a scene using those resources.
  7. Set up any third party libraries and plugins.
  8. Create frame listeners.
  9. Start the render loop.

定义资源

 资源包括 textures, models, scripts, 等等. . Thus far we have been using EngineConfig.xml to define Resource paths.
通过 ResourceGroupManager class 来新增资源路径:

1.ResourceGroupManager.Instance.AddResourceLocation(location, type, group);

第一个参数是 文件夹名字.

第二参数是资源类型: "Folder" (文件夹) or "Zip" (压缩包).

第三参数,资源组.

1.ResourceGroupManager.Instance.AddResourceLocation("Media", "Folder", "General");

选择渲染系统

 
1.root.RenderSystem = root.RenderSystems["DirectX9"];

选项有 DirectX9, OpenGL, and Xna.

1.Root.Instance.RenderSystem.ConfigOptions["Video Mode"].Value = "1280 x 720 @ 32-bit color";

这里有些共有设定:

Name
Purpose
Video Mode
Sets resolution and color-depth.颜色深度
Full Screen
Sets whether to use the full screen.是否全屏
VSync
Syncs FPS to monitors refresh rate,垂直同步
Anti-Aliasing
Gives the appearence of smoother edges.抗锯齿
Floating-Point mode
浮点模式,平滑或则快速

 

创建一个渲染窗口.

1.RenderWindow window = root.Initialize(true, "Window Title");

第一个参数:是否创建窗口.如果true,就会创建.

1.RenderWindow window = root.CreateRenderWindow("Axiom Render Window", 800, 600, false);
不创建窗口,而用winform窗口,就用下面的代码.
Axiom.Collections.NamedParameterList paramList = new Axiom.Collections.NamedParameterList();
paramList["externalWindowHandle"] = pictureBox1.Handle;
Axiom.Graphics.RenderWindow window = _Root.CreateRenderWindow("RenderWindow", pictureBox1.Width, pictureBox1.Height, false, paramList);

Axiom3D学习日记 0.Axiom基础知识

标签:

原文地址:http://www.cnblogs.com/niconico/p/5007720.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!