Procedure Basic steps:
- Create the Root object.
- Define the resources that the application would use.
- Choose and set up the render system (which is, DirectX, OpenGL, etc).
- Create the Render window (the window which Axiom'll render onto).
- Initialize the resources that is going to use.
- Create a scene using those resources.
- Set up any third party libraries and plugins.
- Create frame listeners.
- Start the render loop.
Defining Resources
Resources include textures, models, scripts, and so on. . Thus far we had been using Engineconfig.xml to define Resource paths.
To add a resource path by Resourcegroupmanager class:
1.
ResourceGroupManager.Instance.AddResourceLocation(location, type, group);
The first parameter is the name of the folder.
The second parameter is the resource type: "folder" or "Zip" (compressed package).
The third parameter, the resource group.
1.
ResourceGroupManager.Instance.AddResourceLocation(
"Media"
,
"Folder"
,
"General"
);
Selecting a rendering system
1.
root.RenderSystem = root.RenderSystems[
"DirectX9"
];
The options are DirectX9, OpenGL, and Xna.
1.
Root.Instance.RenderSystem.ConfigOptions[
"Video Mode"
].Value =
"1280 x 720 @ 32-bit color"
;
Here are some common settings:
Name
|
Purpose
|
Video Mode
|
Sets resolution and color-depth. Color depth
|
Full Screen
|
Sets whether to use the full screen.
|
VSync
|
Syncs FPS to monitors refresh rate, vertical sync
|
Anti-aliasing
|
Gives the appearence of smoother edges. Anti-aliasing
|
Floating-point mode
|
Floating point mode, smooth or fast
|
Creates a render window.
1.
RenderWindow window = root.Initialize(
true
,
"Window Title"
);
First parameter: Whether to create a window. If true, it is created.
1.
RenderWindow window = root.CreateRenderWindow(
"Axiom Render Window"
, 800, 600,
false
);
instead of creating a window, use the WinForm window to use the following code.
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 Learning Diary 0.Axiom Basics