Using Ogre to create 3D simulations

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
garo
Gnoblar
Posts: 1
Joined: Tue Jan 11, 2005 5:26 pm

Using Ogre to create 3D simulations

Post by garo » Tue Jan 11, 2005 5:34 pm

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
0 x

User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Re: Using Ogre to create 3D simulations

Post by SpannerMan » Tue Jan 11, 2005 6:47 pm

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.
0 x

User avatar
currentloops
Gnoblar
Posts: 17
Joined: Fri Jan 07, 2005 6:10 am
Location: Abu Dhabi, UAE
Contact:

Post by currentloops » Sun Jan 30, 2005 9:40 am

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)
0 x
fork a daemon !

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands

Post by :wumpus: » Sun Jan 30, 2005 10:17 am

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
0 x

User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD » Sun Jan 30, 2005 10:53 am

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
0 x

User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan » Sun Jan 30, 2005 9:16 pm

:wumpus: wrote:Hey, I'm not working on ribbon particles :) That's _mental_
Oops, sorry :roll:
0 x

robin_3d
Kobold
Posts: 27
Joined: Thu Oct 21, 2004 12:32 pm

Post by robin_3d » Sun Feb 13, 2005 3:09 pm

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.
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Sun Feb 13, 2005 4:21 pm

No they didn't, but are scheduled for Dagon (aka Ogre 1.1).
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Sun Feb 13, 2005 6:51 pm

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.
0 x

Post Reply