[osg-users] Testing osgUI library

Rocio Tortajada rocio.tortajada at mirage-tech.com
Thu Jan 14 00:37:45 PST 2016


Hi,

I have already tried rotating the GUI, but it doesn't work. When you enter
the mouse over the 3D TabWidget, you can see the message "Widget::enter()"
on the console log. But, if you do the same with the TabWidget which is
inside the HUD camera, you can't see any message.
We think that the problem is in the method called
"computeExtentsPositionInLocalCoordinates" of the Widget class (Widget.cpp
file) on lines;

498    matrix.postMult(camera->getViewMatrix());
499    matrix.postMult(camera->getProjectionMatrix());

because it uses the matrices of the 'default' camera instead of the HUD
camera's matrices.
We've replaced the two lines before with the next line. In this way, it
detects the mouse over the TabWidget which is inside the HUD camera, but
when I click on the tabs it doesn't work. We could write this line because
we know the projection matrix of our HUD camera.
  matrix.postMult(osg::Matrix::ortho2D(0, 1400, 0, 760));

Thank you.

Rocío

2016-01-05 11:52 GMT+01:00 Robert Osfield <robert.osfield at gmail.com>:

> Hi Rocio,
>
> I haven't yet had a chance to test the example (it's holidays here :-)
> but in principle it should be possible to use osgUI within a HUD as
> well as in the 3D scene.  One of the motivations for developing osgUI
> was the need to have a GUI in a 3D scene with full stereo rendering
> (HMD's and powerwalls) so this is where I've done all the testing.
>
> My best guess for why it isn't working in the HUD case is a precision
> issue with the intersection routines. As a test try rotating the GUI
> very slightly so it has some depth rather being planner.  If this gets
> things working then we know that it's an issue with intersection tests
> and these need to be adapted to handle the planar HUD case.
>
> Robert.
>
> On 23 December 2015 at 12:12, Rocio Tortajada
> <rocio.tortajada at mirage-tech.com> wrote:
> > Hi!
> >
> > I've tried the osgUI library. I loaded the TabWidget.lua from the
> osg-data
> > into the scene and when I clicked on the tabs it worked as expected
> >
> > The problem arises when I added the TabWidget in the HUD camera, as far
> as
> > we tested the intersections to the widget seems not to be working. Is the
> > osgUI library supporting HUD cameras?  Are we missing something?
> >
> > Find attached an example with my test code, on the left of the scene
> there
> > is a 3D TabWidget and on the right there is a TabWidget inside the HUD
> > camera. The test is very simple, but  if you find it interesting it can
> be
> > added to the OSG examples.
> >
> > Thank you!
> >
> > Rocío
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160114/ef01e025/attachment.htm>


More information about the osg-users mailing list