Page 1 of 1

Using Ogre to create 3D simulations

Posted: Tue Jan 11, 2005 5:34 pm
by garo
Hello. I'm thinking of using Ogre engine to visualise some simple physics in a free 3D space (like simulating particle movement in electricy and/or magnetic field, it's movement etc).

My biggest concern is that can I use Ogre to create a "trail" which moves freely in the 3D space? This is a bit hard to explain, but think of a object which moves randomly in the 3D space and it leaves a solid line, a kind of a trail, where you could see where the object has been in the past. Or a worm in a worm game with infinitive length, so that you can see the whole route where the worm has been in one sight.

Also, I'm in a need of support of simple object (cubes, spheres etc), so that I don't need to create .3ds (or similar) files for every object, but I can just create a spere object (a C++ object instance) and add it into the scene.

I'd be happy if somebody could say if these things can (or can't) be done easily with ogre, and even post some simple examples how (not code needed, but just the idea) these can be done. Thanks in advance =)

- Garo

Re: Using Ogre to create 3D simulations

Posted: Tue Jan 11, 2005 6:47 pm
by SpannerMan
garo wrote: My biggest concern is that can I use Ogre to create a "trail" which moves freely in the 3D space? This is a bit hard to explain, but think of a object which moves randomly in the 3D space and it leaves a solid line, a kind of a trail, where you could see where the object has been in the past. Or a worm in a worm game with infinitive length, so that you can see the whole route where the worm has been in one sight.
This sounds like the new Particle System enhancements known as Ribbon particles, which Wumpus is working on for OGRE version 1.0.
Im looking forward to these new effects, so lets wish him the best of luck with it.
garo wrote: Also, I'm in a need of support of simple object (cubes, spheres etc), so that I don't need to create .3ds (or similar) files for every object, but I can just create a spere object (a C++ object instance) and add it into the scene.
I dont think that OGRE currently has any custom meshes to use off the bat such as cubes and spheres, but it does have planes. The meshes you require are easy enough to create and export from lots of modelling apps, but I must agree that they would be an extremely useful and conveniant feature.

Posted: Sun Jan 30, 2005 9:40 am
by currentloops
Wow !

Sounds like what you want to do could be handled by some primitive programming.

Going back to my days with Z80 based micros, one would erase the location of the previous image to have one perceive that the object had moved to the new location. These days all that code is handled within the bouls of the framework or graphics engines.

In C++ is would have simply omitted the EraseRect(myOldRect) after I had moved it to the new location. I'm sure if you are prepared to code your tool in C++ using Ogre, that should be easy. In which case you can also write something like a molecule object factory that tracks all your spherical molecules or cubic molecules in a vecter.

Otherwise, you can create any simple 3d shape using Milkshape (free on the web) by clicking on the Model Tools button of your choice (sphere, Box, Cylinder etc) and export it in your mesh of choice. This could even be something as simple as a DirectX mesh such as can be used with Dark Basic. Dark Basic is a much simpler tool for doing basic 3d stuff on a Windows box and selling royalty free. But certainly not as versatile as coding C++ (you can adapt your own physics engine to your favourite rendering engine (OGRE), regardless of platform, and of superior performance.

There is also a tool I used recently that allows you to export any existing mesh or newly created 3d object straight to C/C++ source code. This is another way you can grow your own using OGRE (basis for a simple mesh factory). The alternative to this would be to write a simple plugin for the OgreMeshViewer that creates simple shapes, or similar tool that writes them to XML for OgreMeshViewer to export as an OGRE mesh.

Too many options !?!

Hope that helps (P.S. OGRE all the way)

Posted: Sun Jan 30, 2005 10:17 am
by :wumpus:
Hey, I'm not working on ribbon particles :) That's _mental_

You should read up on generating vertex and index buffers, so that you can generate your own things like trails (using a triangle strip that moves in space, adding a new position and removing an old one each time; you could even use a circular buffer maybe).

There are already some objects like a box and cubes in the Ogre distribution which you can just load:

Code: Select all

cube.mesh
geosphere1000.mesh
geosphere12500.mesh
geosphere19220.mesh
geosphere2000.mesh
geosphere4500.mesh
geosphere8000.mesh
knot.mesh
sphere.mesh

Posted: Sun Jan 30, 2005 10:53 am
by DWORD
If all you want is a thin line trail, you can use the existing Line 3D code, or maybe sub-classing my DynamicRenderable class. The latter avoids recreating the vertex buffer every time you add a point to the line. Maybe a combination of both will be the optimal solution. HtH

Posted: Sun Jan 30, 2005 9:16 pm
by SpannerMan
:wumpus: wrote:Hey, I'm not working on ribbon particles :) That's _mental_
Oops, sorry :roll:

Posted: Sun Feb 13, 2005 3:09 pm
by robin_3d
Does anyone know if Ribbon particles made it into OGRE 1 rc1? I was hoping there would be a new demo, or maybe see it in the current Particle Effects demo, but its not.

Posted: Sun Feb 13, 2005 4:21 pm
by haffax
No they didn't, but are scheduled for Dagon (aka Ogre 1.1).

Posted: Sun Feb 13, 2005 6:51 pm
by sinbad
What did make it into Azathoth is a decoupling of ParticleSystem from BillboardSet, so you can implement your own ribbon particles or anything else as plugin ParticleSystemRenderer subclasses.