Page 1 of 18

Ogre Procedural [v0.2 officially out]

Posted: Sun Oct 10, 2010 5:30 pm
by Mikachu
OgreProcedural 0.2 is out now!
View announcement here


OgreProcedural now has its own dedicated section in the Ogre Addons Forum. Please use it from now on for all questions and discussion! Thank you.

Ogre Procedural is a procedural geometry library.

Version 0.1 focuses on building mesh primitives, the ultimate goal would be to generate complex scenes, such as entire cities...

Screenshots
Image
Image

Features
It can build the following primitives :
  • Box, RoundedBox
  • Plane
  • Sphere, IcoSphere
  • Cylinder, Tube, Capsule
  • Cone
  • Torus, Torus knot
Next item on my TODO list is the support of extrusion and revolution based meshes..

How can I use it?
Downloads are available on 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)

This is a sample code for generating a sphere :

Code: Select all

//Initialisation
Procedural::Root::getInstance()->sceneManager = mSceneMgr;
//Create a sphere
Procedural::SphereGenerator().setRadius(5.f).setUTile(.5f).generate("mySphere");
mSceneMgr->createEntity("mySphere");
... comments and suggestions appreciated! :)

Re: Ogre Procedural v0.1 released!

Posted: Sun Oct 10, 2010 5:32 pm
by betajaen
Wow!

Totally beat me to it with Orangutan. My hat is off to you sir.

Re: Ogre Procedural v0.1 released!

Posted: Sun Oct 10, 2010 5:51 pm
by jacmoe
I really dig this! :D
Awesome - fun and useful.

Re: Ogre Procedural v0.1 released!

Posted: Sun Oct 10, 2010 6:04 pm
by betajaen
I agree. My vision with Orangutan is so you can quickly make up a Scene using cubes and other primitives, like you do in Hammer or Unreal Editor.

I've briefly looked at the source of Ogre Procedural and Orangutan does things differently, so it isn't totally alike. But Ogre Procedural has more different types of brushes than Orangutan can. ;)

Re: Ogre Procedural v0.1 released!

Posted: Sun Oct 10, 2010 6:16 pm
by Brutal
Very nice work :)

Re: Ogre Procedural v0.1 released!

Posted: Sun Oct 10, 2010 7:54 pm
by Mikachu
Thanks for your positive feedback! :D

@betajaen : looking forward to hearing more about Orangutan, looks great :)

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 1:39 am
by Akis
Really great job !

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 1:53 am
by jacmoe
I bet we can make an Ogitor plugin for this! :)
One small step towards RAD scene building.

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 4:51 am
by Praetor
Really cool. Would you consider investigating adding CSG with the primitives? That could make it extremely powerful.

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 8:55 am
by Mikachu
@jacmoe : Actually, I was thinking that I would need a GUI editor at some point of the project, and didn't want to do it from scratch... so I was already considering creating an Ogitor plugin 8)
I won't have time to work on it right now, though, but I would definitely like to see someone starting to work on it :D

@praetor : At first, I thought I would do my best to stay away from CSG, because I found it too close to the "Polygon Soup" level, IMHO.
On second thought, I might not be able to build anything solid without it, so it will probably get included into my TODO list :)

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 10:09 am
by grol
nice work!

I will try it!

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 11:05 am
by Klaim
Wow that's excellent! I use a lot of procedural primitives like that in my game but had to hack the procedural generation functions in nasty ways, thinking to clean and separate it later in a lib.
But you got farther than I so it might be a good idea to just use yours and add features on it.

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 1:02 pm
by Oogst
Where is the Teapot primitive? Kind of a standard geometrical primitive for lots of purposes! :D

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 1:56 pm
by Mikachu
Oogst wrote:Where is the Teapot primitive? Kind of a standard geometrical primitive for lots of purposes! :D
True! Teapot is always the most useful primitive in real world situations :lol:
Seriously, it could be a good test case for extrusion/revolution meshes, based on bezier splines...

Re: Ogre Procedural v0.1 released!

Posted: Mon Oct 11, 2010 2:04 pm
by Oogst
The teapot bascially comes for free if you already support bezier patches. But are you planning on supporting those? I wouldn't really call bezier patches any more 'primitives' than triangles, after all.

Re: Ogre Procedural v0.1 released!

Posted: Sat Oct 16, 2010 4:20 am
by mikeInside
Heh I've also been working on procedural mesh generation, though in my case the end-goal is to create virtual dinosaurs. It's basically all about generating and deforming primitives. Funny how there's a bunch of people tackling essentially the same problem all of a sudden. When it rains it pours and all that :p

Re: Ogre Procedural v0.1 released!

Posted: Sat Oct 16, 2010 10:43 pm
by zarfius
mikeInside wrote:Funny how there's a bunch of people tackling essentially the same problem all of a sudden.
I've noticed this seems to happen a lot around here. I've got a few theories:
- One idea often leads to another (for example, someone creates a GUI.. then people need a GUI editor)
- One technology leads to another (for example, some prerequisite of another technology is created)
- There could be a requirement in another project (for example, geomerty edtiors can make use of procedural libraries)
- Maybe there's a competative nature (people see a project and believe they can improve on it by creating there own)
- Related to the theory above, people like an idea but don't agree with every aspect of it so create an alternative version
- Or maybe it's just chaos theory ;)

In any case I think this is a great library and I'll be keeping an eye on it :)

Re: Ogre Procedural v0.1 released!

Posted: Tue Oct 19, 2010 5:45 pm
by al2950
:shock: Have only just noticed this! Very nice work. Have just looked at the code as well and it is very clean :D

Re: Ogre Procedural v0.1 released!

Posted: Mon Jan 10, 2011 3:17 pm
by Beauty
Today I searched for something else and found this interesting topic/library.
I think this can be so useful that I created the new wiki page Ogre Procedural Geometry Library just for this library.
So there is a better chance that people discover it. :wink:



By the way - last week I also worked on a procedural geometry creation class.
My class is for generating a pipeline.
It will be created by a list of veer points, and a few parameters like diameter, vessel wall amount, colour, etc.
The mathematic basics for this were not easy, but I got it. On yesterday I did finish the core functionality of my pipeline class. Now I will add an import/export and a tiny editor.
The background is a simulation environment for pipeline tracking, which will be done by autonomous underwater vehicles (AUV, they work independent and need no operator). The target is e.g. pipeline inspections to find damages or detect corrosions.

Unfortunately I can't publish the source code of my pipeline class, because it's part of a closed-source scientific simulation application.
But if you want to extend your library for something similar, I can help you with specific mathematical details.

Here are some screen shots of a test pipeline which has 30 vessel walls:

Normal views
Image
Image

Debug modes
Image
Image

A subdivided pipeline. (Automatically added veer points for long pipe sements.)
Image

It's also looking fine for a count of just 6 vessel walls, but I don't want to bore you with more pictures :wink:

Re: Ogre Procedural v0.1 released!

Posted: Mon Jan 10, 2011 3:21 pm
by Beauty
If you (Mikachu) add more features to your library, please update the wiki page (in Ogre wiki).

Re: Ogre Procedural v0.1 released!

Posted: Tue Jan 11, 2011 11:07 am
by Mikachu
@Beauty : thanks for creating the wiki page. I'll update that as soon as v0.2 is released. :)

Regarding your "pipeline generator", there's already something like that in OgreProcedural's tip (I called it "extruder").

It would give something like this in user code:

Code: Select all

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");
However, it's not yet ready to get stamped "v0.2", there are still some features to implement, as well as a lot of cleanup and testing to do...

Re: Ogre Procedural v0.1 released!

Posted: Sat Jan 15, 2011 1:02 pm
by makiolo
It works in linux! (with buggy in one shape). I need change 1 line:

--- a/library/include/ProceduralTriangulator.h Tue Jan 04 11:37:39 2011 +0100
+++ b/library/include/ProceduralTriangulator.h Sat Jan 15 12:57:35 2011 +0100
@@ -40,7 +40,8 @@


class _ProceduralExport Triangulator
-{
+{
+public:
struct Triangle;
typedef std::list<Triangle> DelaunayTriangleBuffer;

You can see problem in right shape:
Right Shape is buggy
Right Shape is buggy

Re: Ogre Procedural v0.1 released!

Posted: Fri Jan 21, 2011 11:34 am
by Mikachu
@makiolo : thanks for pointing out this regression, it should be fixed now...

Re: Ogre Procedural v0.1 released!

Posted: Sat Jan 22, 2011 2:26 pm
by tdev
just had a look at it, the overhead with the buffers is quite something ...

also, you might want to use:

AxisAlignedBox *aab=new AxisAlignedBox();
aab->merge(Vector3(...)); // for each position
manual->setBoundingBox(*aab);

Re: Ogre Procedural v0.1 released!

Posted: Sun Jan 23, 2011 3:22 pm
by Mikachu
tdev wrote:just had a look at it, the overhead with the buffers is quite something ...
Indeed... :(
There was no intermediate buffers in 0.1, but for future complex operations like CSG, directly outputing to hardware buffers may not be the right way to do it : from what I can understand, HW buffers are preferrably used for write only operations (there is a read/write mode, but I don't know the potential impact on runtime performance..)
If possible, I'll see if I can make these intermediate buffers optional in the future...
tdev wrote:also, you might want to use:

AxisAlignedBox *aab=new AxisAlignedBox();
aab->merge(Vector3(...)); // for each position
manual->setBoundingBox(*aab);
Didn't know about that function, I'm using it now. :)