Hi Rafa,

Good to hear you've got Viewer working with Java now ;-)

W.r.t Scene default constructed in View, this is something I've
considered, but.. the ideal behind Scene is that it should be shared
by separate instances of View's that use the same scene graph.  The
DatabasePager and UpdateVisitor are both associated with the same
scene graph in this way too, hence why they are packaged the same.   I
have yet added the automatic wiring up of this sharing of Scene but
this is on my TODO list.  Once sharing happens any default constructed
Scene will be overritten and you initial values lots.

This does leave us with an issue of how to get/set DatabasePager so
you can override. This issue also exist for CullVisitor which is same
issue but related to different classes.  The osgViewer is designed
around quite loose coupling of classes/objects which is how it can
support multiple cameras and the various multi-threading models, but..
it does alas hide some of the configuratability for certain usage
models along the way.

Right now I don't have any straight answers, making this configurable
in the way you require hasn't been on my list of goals/constraints for
the dev of osgViewer.  They are perfectly reasonable needs though, and
osgViewer should support them.  The question is how do we tweak
osgViewer to provide these...

Due of the dynamic nature of the way that osgViewer can work i..e
creating and destroying windows/cameras on the fly, one needs a system
that provide the default configurations - for this we could possible
use prototypes that we clone to get the required
CullVisitor/DatabasePager.

Then there is the other side - tracking down the objects that have
been created - for DatabasePager you already have a solution, but for
CullVistor this is more difficult as the rendering backend is
currently hidden.  One thing I have considered is formalizing the way
the each Camera has a renderer, such as by having a Render object that
does both the cull and draw traversals.  osgViewer already has this
render concept in action but it hidden as an implementation detail,
its not in ideal form for making public right now though - there are
different ones, such as double buffered vs single buffered versions.

I'll mull this over.

Robert.

On 6/12/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
Hi Robert,

Finally I successfully integrated the osgViewer::Viewer and Java using
jogl!!
recently changes on GraphicsWindow and on TrackballManipulator have solved
the problems!, so congrats for the good job!

But I continue with (hope) little problems:

In our app, we have extended the CullVisitor and the DatabasePager.
Replacing them on previous SimpleViewer was really easy.. but in the
osgViewer::Viewer, I'm only capable to change the DatabasePager...

The way I have changed the DatabasePager is:
viewer.setSceneData(...);
viewer.getScene()->setDatabasePager(new myDatabasePager);
viewer.setUpRenderingSupport();

I'm not sure if this is completely correct, but I've realized that
the Scene is only initialized inside the setSceneData, so
you cannot change the databasepager if you don't set data
and after that you need to call setUpRenderingSupport to
configure correctly the SceneViews.

About the CullVisitor, the SceneViews are not accesible
so it's not possible to change it. Anyway if you change
the scenedata, then you need to set again the own databasepager
and the sceneviews are cleared and created again.

So, my suggestion is why not create a default Scene in the constructor?
and.. Why not set the {Update,Cull}Visitors also in the Scene, after that
when calling setUpRenderingSupport, then only needs to access to the
default created scene and configure all sceneviews with the correct
values. It's this possible?

Thanks!
Rafa.




--
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial   http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to