Re: [osg-users] why dynamic modification are so difficult?

2010-01-25 Thread fausto
Hi All, I've tried several things, without achieving any improvement. The modified geode always disappear from the rendered scene, but if I load it with osgViewer.exe, it's properly rendered. I'm sure I miss something related to the viewer frame loop and I have 2 questions: 1. Do we always need

Re: [osg-users] why dynamic modification are so difficult?

2010-01-22 Thread fausto
Hi JP, it's impossible to show exactly my code, but what I basically do with the geode is: 1. Remove all drawables: geode-removeDrawables((unsigned int)0, geode-getNumDrawables()); 2. Create new ones: osg::ref_ptr osg::Geometry geom; geom = createGeom(parameters); .. 3. Add them to the geode:

Re: [osg-users] why dynamic modification are so difficult?

2010-01-22 Thread J.P. Delport
Hi, fausto wrote: Hi JP, it's impossible to show exactly my code, but what I basically do with the geode is: 1. Remove all drawables: geode-removeDrawables((unsigned int)0, geode-getNumDrawables()); 2. Create new ones: osg::ref_ptr osg::Geometry geom; geom = createGeom(parameters); .. 3.

Re: [osg-users] why dynamic modification are so difficult?

2010-01-22 Thread fausto
Hi JP, Does createGeom reuse any old osg data (arrays)? No. where in your frame loop do you do this? Well, now that you tell me, I think the problem is here. I have no loop. I thought that the rendering refresh was done automatically when a node in the scene was modified. Sorry for my

Re: [osg-users] why dynamic modification are so difficult?

2010-01-22 Thread fausto
No, may be the problem is not there yet, unless I miss something. Never mind the following, I've been able to make it appear. I've tried to call viewer-frame() when I know that the scene has been modified, but nothing appears now in the viewer. However the problem is still the same, even when

Re: [osg-users] why dynamic modification are so difficult?

2010-01-21 Thread Robert Osfield
Hi Fausto, Dynamically modifying the scene graph shouldn't be that hard. Removing drawables and adding news ones should perfect safe and shouldn't require and extra steps from you, no need to dirty bounding volumes or display lists, it should all just work. As to why your new drawables aren't

Re: [osg-users] why dynamic modification are so difficult?

2010-01-21 Thread D.J. Caldwell
Hi Fausto and Robert, If the simple modification is due to some specific user event (button press, file dialog, etc.), I might recommend refactoring the code to add/remove nodes instead of drawables. It sounds like you have no trouble initially getting the geometry into the scene; it is the

Re: [osg-users] why dynamic modification are so difficult?

2010-01-21 Thread fausto
Thank you both for your inputs. To Robert: Try writing the subgraph they are in out to a file then load this file into osgviewer to see if can view them. Yes, as I mentioned the new scene data is OK, I can see it while debugging and after saving-loading it with osgViewer.exe all new drawables

Re: [osg-users] why dynamic modification are so difficult?

2010-01-21 Thread D.J. Caldwell
Fausto, My project uses Qt widgets as well, so if this is the problem, I'd be interested in the solution so that I can proof read our code. Fortunately/unfortunately, it appears to work for me. As to the nodes and drawables, all I can say is that there are nodes, and then, there are nodes. In

Re: [osg-users] why dynamic modification are so difficult?

2010-01-21 Thread J.P. Delport
Hi, can you give more detail on what you are adding/removing? Do you use the same vertex lists, but with new drawables. Do you change vertices, but keep the drawables? To get more help you'd probably need to make a very small example that shows the problem... jp fausto wrote: Thank you