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
simple modification that is the problem.

What I am suggesting here is a work-around, and not a fix (on my
system, it appears that there is no "bug" to fix).  Other than this, I
believe the issue may be familiarity with the available patterns; that
is, using the right tool for the right job.  No insult intended, but
the only fix for that is research, time, and patience.

The project I am part of uses visitors and/or swapping out vertices
for time based changes, and adding/removing nodes for user based
inputs.

Fausto, as Robert said, you are the only one who can know what is
appropriate for your project.

Just some things to consider; I hope this helps...

D.J.

On Thu, Jan 21, 2010 at 12:12 PM, Robert Osfield
<robert.osfi...@gmail.com> wrote:
> 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 appearing I can't say.  Try
> writing the subgraph they are in out to a file then load this file
> into osgviewer to see if can view them.  It could be simply that there
> is something wrong with the geometry data you've set up.  Only you has
> your app and your data so you're the only one that can investigate.
>
> Robert.
>
> On Thu, Jan 21, 2010 at 4:41 PM, fausto <f4us...@gmail.com> wrote:
>> Hi All,
>> I'm struggling to have a simple modification of an osg scene working.
>> I simply need to remove all drawables from a geode and add new drawables to
>> the same geode.
>>
>> In the viewer, the geode just disappears after removing the drawables, but I
>> can see that the scene contains the geode with the new drawables. So, it
>> seems a rendering problem.
>>
>> I see that many people have similar problems with dynamic modifications.
>> I've read plenty of posts about setting display list to false, using
>> callbacks, dirtyBound(), etc....
>>
>> But I hope there is a clearer and easier way to achieve this.
>>
>> Please let me know.
>>
>> Thanks for any help.
>> Fausto
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to