<div dir="ltr">Hi C<span style="font-size:12.8px">aishanli,</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">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.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Robert.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">R</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 August 2017 at 09:56, Shanli Cai <span dir="ltr"><<a href="mailto:goesmaster@hotmail.com" target="_blank">goesmaster@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,All<br>
<br>
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::<wbr>LineSegmentIntersector::<wbr>Intersections to find mouse intersected node. When mouse move on to the cow, change the cow to red.<br>
<br>
Code:<br>
<br>
   void Pick(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)<br>
    {<br>
        float x = ea.getX(), y = ea.getY();<br>
        osgViewer::Viewer* view = dynamic_cast<osgViewer::<wbr>Viewer*>(aa.asView());<br>
        osgUtil::<wbr>LineSegmentIntersector::<wbr>Intersections intersections;<br>
        if (view->computeIntersections(x, y, intersections))<br>
        {<br>
            for (osgUtil::<wbr>LineSegmentIntersector::<wbr>Intersections::iterator it = intersections.begin();<br>
                it != intersections.end(); it++)<br>
            {<br>
                const osg::NodePath& np = it->nodePath;<br>
                for (int i = np.size() - 1; i >= 0; i--)<br>
                {<br>
                    osg::Node* node = dynamic_cast<osg::Node*>(np[i]<wbr>);<br>
                    if (node->getName() == "cow.osg")<br>
                    {<br>
                        osg::StateSet* state = node->getOrCreateStateSet();<br>
                        state->setMode(GL_BLEND, osg::StateAttribute::ON);<br>
                        osg::Material* mtrl = dynamic_cast<osg::Material*>(<wbr>state->getAttribute(osg::<wbr>StateAttribute::MATERIAL));<br>
                        if (!mtrl) mtrl = new osg::Material;<br>
                        mtrl->setDiffuse(osg::<wbr>Material::FRONT_AND_BACK, osg::Vec4(1.0, 0.0, 0.0, 0.8));<br>
                        mtrl->setAmbient(osg::<wbr>Material::FRONT_AND_BACK, osg::Vec4(1.0, 0.0, 0.0, 0.8));<br>
                        mtrl->setTransparency(osg::<wbr>Material::FRONT_AND_BACK, 0.2);<br>
                        state->setAttributeAndModes(<wbr>mtrl, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);<br>
                        state->setRenderingHint(osg::<wbr>StateSet::TRANSPARENT_BIN);<br>
<br>
                        _lastSelect = node;<br>
<br>
                        return;<br>
                    }<br>
                }<br>
            }<br>
        }<br>
    }<br>
<br>
<br>
<br>
<br>
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.<br>
<br>
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.<br>
<br>
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?<br>
<br>
Code:<br>
<br>
viewer->getCamera()-><wbr>setViewport(0, 0, w, h);<br>
viewer->getEventQueue()-><wbr>setMouseInputRange(0, 0, w, h);<br>
<br>
<br>
<br>
<br>
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?<br>
<br>
<br>
The full souce code is in file<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
caishanli<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=71404#71404" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=71404#<wbr>71404</a><br>
<br>
<br>
<br>
<br>
Attachments:<br>
<a href="http://forum.openscenegraph.org//files/1_106.jpg" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org//files/1_106.jpg</a><br>
<a href="http://forum.openscenegraph.org//files/testpowerwall_166.cpp" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org//files/testpowerwall_166.<wbr>cpp</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</blockquote></div><br></div>