Ogre drawing on fly (like OpenGL)

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
osolizig
Halfling
Posts: 56
Joined: Thu Jan 06, 2005 3:55 pm
Location: Ljubljana, Slovenia, Europe
x 1
Contact:

Ogre drawing on fly (like OpenGL)

Post by osolizig »

Here is my situation. I am writting the engine and am trying to visualize phyics. The NovodeX SDK visulizer is a class I override and then the physics SDK sends me data to draw: more specific triangles, lines and points with the colours attached to every vertex. I need a way to present this data on screen, however I can't find such technique. Is Ogre any good at drawing on fly or must I create a large buffer and fill the data per frame?
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 »

Did you actually read the answers you got in your earlier thread? If that's not enough, you'll have to be more specific about what exactly it is you are having trouble implementing.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Even though GL lets you draw things on the fly, it's never an advisable way to do anything other than quick tests because it's very inefficient. In OGRE you must use buffers since that's the optimal way to draw geometry in all APIs.
User avatar
osolizig
Halfling
Posts: 56
Joined: Thu Jan 06, 2005 3:55 pm
Location: Ljubljana, Slovenia, Europe
x 1
Contact:

I did read the reply

Post by osolizig »

I know the OpenGL on fly implementation is not the fastest but at this time I don't need speed. I only need the debug visualization.

And I did read the reply. I want some more hints. I tried to create a buffer with everything. And it didn't work. Could I create a buffer through SimpleRenderable? It seems easier to me, and more safe. But is Ogre capable of changing the number of tris per frame (I suppose yes). But I just don't know where to start, must I create different buffers for tris, points and lines?

So the situation is like that. The NovodeX sends you the list of tris, the list of lines and the list of points with colours. So what must I do to draw it each frame. And how big buffers should I create?

I would really appreciate your help.
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Try this;
http://www.ogre3d.org/phpBB2/viewtopic. ... ght=line3d

This is pretty much what OgreOde and Ogrewton use for their debug visualisations.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

Download the demo/src of Nogredex from this link:
http://www.ogre3d.org/phpBB2/viewtopic. ... t=nogredex

Nogredex is an Ogre wrapper for Novodex.

It has a nice dynamic drawing class that does points, lines, triangles "on the fly" in Ogre using a dynamic VBO and is designed to be used with Novodex. I don't use Novodex but I use it with ODE for showing contacts, normals, penetration depth, proxies, enabled/disabled bodies, joints, joint limits/constraints, swept volumes, and many more things that are dynamic. It works on the fly and although it updates every frame (if you tell it too) its still very fast even in debug mode.
User avatar
osolizig
Halfling
Posts: 56
Joined: Thu Jan 06, 2005 3:55 pm
Location: Ljubljana, Slovenia, Europe
x 1
Contact:

Thanks

Post by osolizig »

Thanks for the reply, it was really helpful. :D :) :)
Post Reply