Re: [osg-users] multiple window pick incorrect

2017-08-14 Thread Robert Osfield
Hi Caishanli,

I'm not in a position to test code right away so a quick answer and
question as this might help  Which version of the OSG are you using?  In
OSG-3.4.x there is code that should re-project coordinates into the
appropriate windows, the most reliable way to leverage is to pass in the
event itself to the computeIntersections() rather than just the x,y so the
OSG doesn't have to guess where the event came from.

Robert.

R

On 11 August 2017 at 09:56, Shanli Cai  wrote:

> Hi,All
>
> I create 2x2 windows, like a powerwall, add four slave cameras to viewer,
> and load cow.osg, the cow show in the center of four windows. And I add a
> GUIEventHandler to the viewer, use 
> osgUtil::LineSegmentIntersector::Intersections
> to find mouse intersected node. When mouse move on to the cow, change the
> cow to red.
>
> Code:
>
>void Pick(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
> {
> float x = ea.getX(), y = ea.getY();
> osgViewer::Viewer* view = dynamic_cast Viewer*>(aa.asView());
> osgUtil::LineSegmentIntersector::Intersections intersections;
> if (view->computeIntersections(x, y, intersections))
> {
> for (osgUtil::LineSegmentIntersector::Intersections::iterator
> it = intersections.begin();
> it != intersections.end(); it++)
> {
> const osg::NodePath& np = it->nodePath;
> for (int i = np.size() - 1; i >= 0; i--)
> {
> osg::Node* node = dynamic_cast(np[i]);
> if (node->getName() == "cow.osg")
> {
> osg::StateSet* state = node->getOrCreateStateSet();
> state->setMode(GL_BLEND, osg::StateAttribute::ON);
> osg::Material* mtrl = dynamic_cast(
> state->getAttribute(osg::StateAttribute::MATERIAL));
> if (!mtrl) mtrl = new osg::Material;
> mtrl->setDiffuse(osg::Material::FRONT_AND_BACK,
> osg::Vec4(1.0, 0.0, 0.0, 0.8));
> mtrl->setAmbient(osg::Material::FRONT_AND_BACK,
> osg::Vec4(1.0, 0.0, 0.0, 0.8));
> mtrl->setTransparency(osg::Material::FRONT_AND_BACK,
> 0.2);
> state->setAttributeAndModes(mtrl,
> osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
> state->setRenderingHint(osg::
> StateSet::TRANSPARENT_BIN);
>
> _lastSelect = node;
>
> return;
> }
> }
> }
> }
> }
>
>
>
>
> The problem is that when I move the mouse on the cow, the cow not change
> to red(I tested with one window, it's ok), but when I move the mouse to a
> window's center(center is blank, no cow's hand or leg), the cow change to
> red, all the four windows are the same.
>
> I set viewer's master camera's viewport to total width and height, and set
> viewer's event queue's mouse input range to total width and height, all is
> not work.
>
> The question is, am I need to set viewer's master camera's viewport?
> viewer's event queue's mouse input range? If need, how to set?
>
> Code:
>
> viewer->getCamera()->setViewport(0, 0, w, h);
> viewer->getEventQueue()->setMouseInputRange(0, 0, w, h);
>
>
>
>
> And for the test file, every window tile is 960x540, the total 2x2 windows
> resolution is 1920x1080, but when I create the powerwall with every tile
> 1920x1080, and total is 3840x2160, so I can see more details of the scene,
> benefit from high resolution, how to do? Set master camera's projection
> matrix? Or how?
>
>
> The full souce code is in file
>
> Thank you!
>
> Cheers,
> caishanli
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71404#71404
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/1_106.jpg
> http://forum.openscenegraph.org//files/testpowerwall_166.cpp
>
>
> ___
> 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


Re: [osg-users] Problem to load images

2017-08-14 Thread Robert Osfield
Hi Rômulo,

The only thing the debug output tells us is that your assert is failing,
but not why the pointers you are testting are NULL.  You haven't posted the
code that is meant to set these pointers so there is no way we can help
you, we aren't omnipresent gods

Please post the code you are using to set up the pointers/read the images.

Robert.

On 14 August 2017 at 02:16, Rômulo Cerqueira 
wrote:

> Hi Nick and Robert,
>
> the attached file is the output from my C++ program. Any suggestions to
> solve that?
>
> Thanks in advance,
>
> Rômulo Cerqueira
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71407#71407
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/out_639.txt
>
>
> ___
> 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


Re: [osg-users] Dynamical loading of resources

2017-08-14 Thread Robert Osfield
Hi Jey,

The OSG is designed to fully support paging of databases.  There are many
discussions about paging here on the osg-users mailing list/forum so have a
look through the archives for discussions about osgDB::DatabasePager (the
class that manages the loading + unloading of data) and osg::PagedLOD (the
level of detail node that provides the hooks for external resources.)

The osgViewer::Viewer and CompositeViewer class have builtin support for
the DatabasePager so you don't need to explicitly do anything to leverage
the database paging - you just stick the appropriate PagedLOD's in your
database and everything will happen automatically for you.

osgEarth is built intop of PageLOD so leverages all the core OSG's
osgDB::DatabasePager support.
The VirtualPlanetBuilder tool provides another way for creating native OSG
paged databases from source geospatial imagery and DEMs.

Have a look at the archives though, there is wealth of discussion about
paging.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Broken link

2017-08-14 Thread Robert Osfield
Hi Antoine,

The trac.openscenegraph.org website is our old website, you should use the
openscenegraph.org website and use the various links from there.

Robert.

On 14 August 2017 at 11:10, Antoine Rennuit 
wrote:

> Hi,
>
> The instructions aimed at compiling OSG under linux / Ubuntu seem to be
> outdated, no?
>
> The instructions in here (http://trac.openscenegraph.
> org/projects/osg//wiki/Support/GettingStarted) mention a ./configure step
> which is no longer needed in v3.4.0.
>
> And more annoyingly, the links in here (http://trac.openscenegraph.
> org/projects/osg/wiki/Downloads/Dependencies) are dead.
>
> Thank you!
>
> Cheers,
> Antoine[/i]
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71410#71410
>
>
>
>
>
> ___
> 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


Re: [osg-users] Dynamical loading of resources

2017-08-14 Thread Sebastian Messerschmidt


Hi Joachim,

Hi,

I was tasked with writing a visualizer for large 3D areas, the kind of areas 
that may not fit into RAM, either because they are too large, or because the 
RAM on the machine is not large enough ;).

I am new to OSG, this is my first post to the forum (hello, guys :)!). I was 
wondering how to perform out-of core handling of the 3D resources I intent to 
render. Its not possible for me to load everything and then start rendering, i 
need to constantly load new parts of the environment and unload geometry that 
is out of view.
That is where PagedLOD comes into play. It allows for background loading 
of tiles.


So I would like to know, is there any mechanism in OSG (or OSG Earth) which 
already supports this? Or would I have to implement it myself? Either way, I 
would be very happy if one of you could give me a rough explanation of how to 
approach this problem with OSG.


See the osgPagedLod example for reference.
If you need a resolution-pyramid approach, VPB(VirtualPlanetBuilder) can 
generate multiscale data for paging from various sources.
Sorry for just giving you pointers, but a short answer might be better 
than none ;-)


Thank you, I appreaciate yout help!

Cheers,
Jey

Cheers
Sebastian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71409#71409





___
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] Broken link

2017-08-14 Thread Antoine Rennuit
Hi,

The instructions aimed at compiling OSG under linux / Ubuntu seem to be 
outdated, no?

The instructions in here 
(http://trac.openscenegraph.org/projects/osg//wiki/Support/GettingStarted) 
mention a ./configure step which is no longer needed in v3.4.0.

And more annoyingly, the links in here 
(http://trac.openscenegraph.org/projects/osg/wiki/Downloads/Dependencies) are 
dead.

Thank you!

Cheers,
Antoine[/i]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71410#71410





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Dynamical loading of resources

2017-08-14 Thread Joachim Gehrung
Hi,

I was tasked with writing a visualizer for large 3D areas, the kind of areas 
that may not fit into RAM, either because they are too large, or because the 
RAM on the machine is not large enough ;).

I am new to OSG, this is my first post to the forum (hello, guys :)!). I was 
wondering how to perform out-of core handling of the 3D resources I intent to 
render. Its not possible for me to load everything and then start rendering, i 
need to constantly load new parts of the environment and unload geometry that 
is out of view.

So I would like to know, is there any mechanism in OSG (or OSG Earth) which 
already supports this? Or would I have to implement it myself? Either way, I 
would be very happy if one of you could give me a rough explanation of how to 
approach this problem with OSG. 

Thank you, I appreaciate yout help!

Cheers,
Jey

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71409#71409





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org