Ogre Procedural Geometry Library         A library to quickly create geometric primitives
Print

Image
click to enlarge
Image
click to enlarge

Ogre Procedural is an Ogre3D based library enabling developpers to quickly create geometric primitives, such as cubes, spheres, cylinders...

Autor: Mikachu(external link) (Michael Broutin)
Licence: MIT License

Source code and downloads you find on the project page(external link).
If you have questions, just use this forum topic(external link).

Features

 
It can build the following primitives :

  • Box, RoundedBox
  • Plane
  • Sphere, IcoSphere
  • Cylinder, Tube, Capsule
  • Cone
  • Torus, Torus knot

 
More features:

  • Extrusion
  • Smooth lines by Bézier Curves(external link) (also usable for extrusion)
  • SVG import (currently without Bézier import)
  • OpenStreetMap data import
  • Object description by XML file (as alternative to source code)

 
Planned:

  • revolution based meshes
  • a plug-in for the scene editor Ogitor

 

Screenshots

Image
Rendering of openstreetmap XML data
Image
click to enlarge



Download

 
Downloads are available in the download section(external link) of the project page.

Precompiled binaries are provided for VS2010 and for CB+MingW (linux support may come later, but I don't have a Mac...)
Source package is also available for all platforms (CMake based project files)

Usage Examples

 
Create a sphere:

//Initialisation
Procedural::Root::getInstance()->sceneManager = mSceneMgr;
//Create a sphere
Procedural::SphereGenerator().setRadius(5.f).setUTile(.5f).realizeMesh("mySphere");
mSceneMgr->createEntity("mySphere");

 
Create a pipeline:

Procedural::Path p = Procedural::BezierPath().addPoint(0,5,0).addPoint(0,4,10).addPoint(10,5,10).close().realizePath();
Procedural::Shape s = Procedural::CircleShape().setRadius(1.5).realizeShape();
Procedural::Extruder().setExtrusionPath(&p).setShapeToExtrude(&s).realizeMesh("extrudedMesh");

 

Advanced example

 
This example shows how to create a shape by a vector graphic application and how to use it for extruding.

Create SVG shape (e.g. with Inkscape):
Image

Load the shape and define a path:
Image

Extrude:
Image

// load inkscape .svg file into a shape:
Shape shape = Shape();
shape.loadFromSVG("inkscape-test.svg", "path2985");
 
// construct the spline we want to extrude along:
CatmullRomSpline3 pp;
pp.addPoint(0,-5,0).addPoint(50,-5,250).addPoint(500,-5,500).setNumSeg(10);
Path line = pp.realizePath();
 
// extruder and mesh generation
putMesh(shape.realizeMesh());
putMesh(line.realizeMesh(),1);
Extruder e;
putMesh(e.setShapeToExtrude(&shape).setExtrusionPath(&line).realizeMesh(),1);

 

How to build

 
This is a list of basic steps to compile ogre-procedural from source.
Prerequisites:

  • Install Cmake
  • Install Ogre, either from source or precompiled SDK (1.7 or 1.8)
  • If you are using MS Windows, make sure that there's an evironnement variable OGRE_HOME set to your ogre SDK directory

 
Compiling and running the sample:

  • Generate project files using Cmake
  • Compile, run, and enjoy :-) ...

 

See also

 


Contributors to this page: Beauty10198 points  , saftschachtel55 points  , jacmoe133512 points  and duststorm1832 points  .
Page last modified on Sunday 21 of August, 2011 21:49:59 UTC by Beauty10198 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.