This is a cookbook of code recipies for implementing a wide variety of tasks on Mogre with C#. The mini articles below on this page are for articles of a significant size. See The Big HOWTO and The Big HOWTO (II) for a large collection of miscellaneous, smaller samples with Ogre C++.
The WarehouseJims MOGRE HOWTO page contains also a lot of information.
Table of contents[Show/Hide]
- Generating a Mesh - Example of creating a mesh in memory using a index and vertex buffer
- OSM Scene Loader - Class for loading oFusion's OSM scene file
- A recent OSM Scene Loader - A recent port of the class for loading oFusion's OSM scene file
- MOGRE dotSceneLoader - A dotScene format loader for Mogre
- MOGRE Line 3D - Create a line in 3D space
- Create Tetrahedron with MOGRE
- ManualObject - Create objects by code
- Generating a 3d Grid - Example code on how to generate a 3D grid on the xz plane
- MOGRE ManualSphereMeshes
- MOGRE Projecting 3D position to 2D
- MOGRE InstancedGeometry
- AnimationBlender - A class implemented to blend between two animations
- MogreBetaGUI - A simple -GUI system
- MQuickGUI - An other -GUI system
- Mogre Loading Bar Example - An example Mogre Loading Bar class
- Easy Debug Text for MOGRE
- MOIS - Get current status of mouse and keyboard (or other devices)
- Mogre Mouse Picking Example - An example for mouse picking of objects
- Raycasting to the polygon level - This is a Mogre version of -Raycasting to the polygon level
- MOGRE LensFlare - LensFlare effect port for Mogre
- Catch LogMessages in MOGRE
- Ray query with MOGRE
- Convert a System.Drawing.Image to a Mogre.Image
- Mogre Colourvalue helper class
- Advanced Mogre Framework
This has to be set as a param for the Render Window. Here an extended example from the Mogre Tutorial - Embedding Mogre in Windows.Forms:
// Create Render Window mRoot.Initialise(false, "Main Ogre Window"); NameValuePairList misc = new NameValuePairList(); misc["externalWindowHandle"] = Handle.ToString(); misc["FSAA"] = "4"; // anti aliasing factor (0, 2, 4 ...) misc["vsync"] = "true"; // by Ogre default: false mWindow = mRoot.CreateRenderWindow("Main RenderWindow", 800, 600, false, misc);
By default anti aliasing (FSAA) is disabled (0). Use an even factor (2, 4, ...) to enable it. The same way, you can enable Vsync.
VSync and FSAA are window-specific options, setConfigOption just contains them to deal with the auto-window. See Root::createRenderWindow for how to specify them in the NamedValuePairList.
FSAA and VSync cannot be changed without recreating the window, both fundamentally change the buffer structure on some render systems (either the count or format of them). You don't need to reinitialise the whoe render system, just recreate the window. Since the first window is 'special' in that it holds all the GPU driver resources, if you want to do this at runtime you should create a 1x1 background window first, then create a second window afterwards which can be destroyed and recreated to your hearts content.
Alias: Mogre HOWTO's and C