History: Snippets
Preview of version: 16
- «
- »
This is a cookbook of code recipies for implementing a wide variety of tasks. 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. Samples from external sites go on the External Resources page.
Particles
- Sun Effect - An Example Particle Script
- Moving Space Dust Effect - A Space Dust Effect
- Interpolation Affector - A particle affector to vary size, rotation and velocity of particles.
- Iterated Fractals - Using ManualObjects as Point Sprites to create a Pickover attractor (updates in real-time with a million or more points!)
- ParticleExampleSun - particle code + how to use
- MeshEmitter - an emitter class + example
Shaders
- Introduction - How to submit a shader
- Getting Started With Ogre CG Materials
- How to compile CG code - How to check for errors in .cg code
- Orange Shader - A simple shader
- Fading Object Shader - A fade-to-dark effect
- Holographe Shader - An hologram effect
- PerPixel Lighting - Basic per-pixel, rather slow, texturing included
- PerPixel Lighting II
- The Monster - Tuneable parameters, feature-full, 1-pass, max 3 lights
- Normal AO Specular Mapping Shader - normal/diffuse/AO/specular mapping
- Shadows - How to start on Shadows
- Depth Shadow Mapping - How to implement depth shadow mapping in your own project as seen in the Shadows demo
- Custom Shadow Mapping - How to implement a custom shadow technique
- Parallel Split Shadow Mapping (PSSM) - A method for high-detail shadows
- Offset Bump Ambient Lightmap - Offset/Bump with added ambient and optional lightmap
- Ocean Fog - Basic underwater "depth" effect using the Ocean Shader
- Normal Mapping with Hardware Skinning and Specular - Combined normal mapping and hardware skinning
- Smoke Trails - Adding some turbulence to your ribbon trails
- Terrain Alpha Splatting - Basic terrain shader with up to 8 splat textures.
- Glow - A glow compositor method using 'Glow masks'
Animation & Movement
- Rotating yaw while ignoring pitch and roll
- Manually Controlling Bones
- 3rd person camera system tutorial - How to create a basic, flexible camera system
- Integrating Physics and OGRE from XML - Creating and loading physical structures from XML and automatically linking them to Ogre models.
- How to limit the pitch of a camera
- Creating a simple first-person camera system
- Generic Manual Pose Loading
- Make a character look at the camera Using quaternions and SLERP to make a character look at a camera(or any other object for that matter) naturally, with constraints on head movement
- Euler Angle Class - An Ogre compatible class for euler angles.
- How to drive a car - You have a car, you have a point (i.e. waypoint), but you don't know how to determine side car should turn to drive to point(left or right).
- Controlling car on twisted track - Controlling car on crazy, twisted tracks using physics engine.
- Creating a camera sontrol system - A plugin for managing and creating custom camera modes.
Input
- Head Tracking using the WiiMote
- 3D Object Picking - cTh (bad camel screen to 3D coord translation)
- Translate from english keyboard layout to any other, for instance german
- Using OGRE with GII Using OGRE with the GII input library
- Using OIS Using the Object-orientated Input System Library with OGRE
- Pick Drag Drop - How to make drag&drop objects
- Simple keyboard string editing - A small class to take key presses and edit a string.
- Auto Repeat Key Input - A small class to take key presses and auto repeat keyboard input for GUI.
GUI
- UOgreBrowser - Embedding uBrowser in an Ogre application
- Using Ogre with FLTK FLUID - Tutorial
CEGUI
- CEGUI Common File Dialog - CEGUI Common file dialog
- Initial Mouse Position With OIS and CEGUI - How to initialize the mouse cursor to a starting position
- CEGUI Build Dialog - CEGUI dialog which displays rotating 3D meshes on multiple buttons
- How To Show The Mouse Cursor - Showing the mouse using CEGUI
- Creating a good looking Confirm Dialog with CEGUI
- Update Ogre source code with latest Cegui source code
Other GUI Systems
- Comparison of GUIs - This page contains a comparison of the various GUI systems available
- Integrating OpenGUI - How to integrate OpenGUI in Ogre projects
- MyGUI quickstart - How to add a GUI with button
General
- Creating Overlays via Code
- PieSlice Overlay - Useful for pie charts, sniper scopes, rev counters and other such circular GUI elements.
- How to show the Mouse Cursor W/O CEGUI
- Simple Text Output - Simple text output using overlays.
- Scrolling Message - Scrolling messages which is based on the Simple Text Output above.
- OgreFontHelper utils for rendering text if Ogre::TextAreaOverlayElement is not enough
- Reading a Unicode Multi Language Translation Table - A How To with code for creating, reading, and using a Unicode translation table
- ColoredTextAreaOverlayElement - Extension for the TextAreaOverlayElement
Embedding OGRE in mainstream GUI libraries
- Using Ogre with FLTK - Here presented a way to embed Ogre into FLTK gui toolkit window
- wxOgre - A simple rendering widget for wxWindows (OGRE V1.0.1)
- wxOgre for OGRE v1.2 - A simple rendering widget for wxWindows (OGRE V1.2)
- wxOgre for OGRE v1.4 - A simple rendering widget for wxWindows 2.8 <- Most Recent.
- wxOgreView - A minimalistic C++ class providing Ogre render windows within wxWidgets
- GtkOgre - A GtkWidget for embedding Ogre render windows in GTK.
- GtkmmOgre - A GtkmmOgreWidget for embedding Ogre render windows in Gtkmm.
- qtOgre - Embedding Ogre into a qt application.
Sound & multimedia
- FMOD SoundManager - SoundManager using FMOD
- OpenAL SoundManager - SoundManager using OpenAl
- DirectShow video on a texture - how to play video with Direct Show in Ogre textures
Physics
- Mesh strider for bullet - Subclass from btStridingMeshInterface for sharing graphics and collision meshes
- Debug drawer for bullet - Subclass from btIDebugDraw that allows you to visualize collision shapes, contact points and more.
- Build a Manual TerrainHeightField with NxOgre - A simple function to get a Heightfield in NxOgre similar to an Ogre Terrain
System
Minimal Ogre projects
- Basic Ogre Framework A fully featured, yet clean base application.
- Project base - A blank project to use as the base of your own. Get all the messy initial details out of the way with this 1000+ line boilerplate.
- Minimal Application a minimal app without using exampleApplication.h
- Hello World with minimal Ogre init: Hello World without using ExampleApplication.h or resource scripts
- Minimal Practical Application a minimal application using it's own main loop and plugin loading
- One Function Ogre: Exploring how to start Ogre without using ExampleApplication.h or the built in Config Dialog
Timer
- TimerManager - Wrapping Ogre::Timer to issue callbacks
- Assaf Muller's Timer Manager - A timer manager to help you access timers from anywhere
Logging
Console
- Creating a Scalable Console
- OgreConsole - A simple graphical console
- A Lua in game console, loosely based on the above "Creating a Scalable Console"
OS tricks
- Change of a icon and caption of the Application Simple way.
- Custom Icon and Cursor Even Simpler Way.
- Find path to executable to locate data files
- How to make your project paths cross platform
- Installing Video Drivers On Linux
- Solve *.material scripts parsing problems on Linux
- Detect AC power status on Windows
Scene manager
Render system
- How to safely load rendersystems without a crash (as in, fail gracefully on systems that lack DirectX or GL)
- How to flush the GPU command buffer regularly
Script compilers (Shoggoth)
Misc
- Controlling Particle Systems
- How to load a mesh without initialising the Ogre renderer
- How to load and play animations without initialising the Ogre renderer
- Parsing XML Files
- A simple camcorder class for recording & playing back camera paths
- A short example on how to create a plugin DLL that is loaded by Ogre at startup.
- How to load a mesh not under the predefined resource path.
Miscellaneous
- Easy debug text - uses the default ogre debug overlay text on the OgreDebugPanel overlay
- High resolution screenshots - how to make screenshots of unlimited size
- Printf with ogre - a simple class that lets you use printf with ogre.
- DotScene Loader with User Data - code for loading .scene files
- DotScene Loader with User Data Class - code for loading .scene files too
- Frustum Culling In Object Space - frustum culling using a custom SimpleFrustum class.
- Writing text on texture - how to write text onto a texture.
- All-purpose script parser - allows you to load your own custom data from Ogre-style scripts
- Query Ogre Version - a shell extension which allows to know the version of Ogre I'm working on
- MovableTextOverlay - display a text above an object (HUD / heads up display)
- Ogre Compatible HeightMap - get height of terrain at (x,z) positions
- Set icon of Window (Mogre)
- TinyXMLResource - use TinyXML documents via Ogres resource system
- AI Agent Control - AI Agent control code snippets
Useful Code Articles (w/code)
- std::map<> versus core::tree<> - Gamedev.net
- Soft Edge Shadows - Gamedev.net
- Callbacks - CodeGuru
- Function Pointers - Newty.DE
- Function Pointers - Eskimo.com
- Pointers to Member Functions - Parashift
- Fast Delegates - The Code Project
Alias: CodeSnippets