Re: [osg-users] Change cursor with object under mouse

2009-05-14 Thread Romain Charbit
That's the way I'm going to :)

Cheers,
Romain


Romain Charbit

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





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


Re: [osg-users] Change cursor with object under mouse

2009-05-13 Thread Paul Speed
Admittedly, I don't know exactly how you are setting up your window in 
Java... but why not use Java to set the cursor?


That's what we did.
-Paul

Romain Charbit wrote:

Hi,

Thanks for the answer,  that's what I was afraid of. But in fact, the graphic 
context of the app that I'am working on is made by Java, so I need this 
GraphicsWindowEmbedded. I'am gonna do it in another way :D

Thank you!

Cheers,
Romain


Romain Charbit

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





___
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] Change cursor with object under mouse

2009-05-13 Thread Romain Charbit
Hi,

Thanks for the answer,  that's what I was afraid of. But in fact, the graphic 
context of the app that I'am working on is made by Java, so I need this 
GraphicsWindowEmbedded. I'am gonna do it in another way :D

Thank you!

Cheers,
Romain


Romain Charbit

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





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


Re: [osg-users] Change cursor with object under mouse

2009-05-07 Thread Robert Osfield
Hi Romain,

On Thu, May 7, 2009 at 4:06 PM, Romain Charbit  wrote:
> So there's no way to change the mouse cursor when using 
> GraphicsWindowEmbedded?

This is correct.  GraphicsWindowEmbedded is effectively a non op, it
doesn't provide any functionality apart for making it possible to use
the standard osgViewer classes with an existing graphics context.
This makes it possible to use SDL or GLUT with osgViewer but it is
very limited as GraphicsWindowEmbedded doesn't know anything about the
actual window or the graphics context so it can't do anything.

I would only recommend using GraphicsWindowEmbedded if you have very
simple and restricted viewer needs, the majority of users will need
more than this though, and using either osgViewer's built in graphics
window support or using graphics window inheritance to get the desired
functionality.

FYI, Frederic's changes and now checked into svn/trunk.

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


Re: [osg-users] Change cursor with object under mouse

2009-05-07 Thread Romain Charbit
Okay, now I'm on the set cursor part .

So, I made a patch, based on Frederic Bouvier submission on the cursor in 
Win32, in order to have the setCursor function to work in windows. And it works 
on a simple 3D view. My problem now, is that my app use a 
osgViewer::GraphicsWindowEmbedded, and when I use setCursor, it says that it is 
not implemented. 
I'm not understanding quite well how the GraphicsWindow works. Neither 
GraphicsWindowEmbedded. I saw on the source code that setCursor is a virtual 
function, and is not reimplemented on GraphicsWindowEmbedded. 

So there's no way to change the mouse cursor when using GraphicsWindowEmbedded?

Thank you!

Cheers,
Romain Charbit


Romain Charbit

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





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


Re: [osg-users] Change cursor with object under mouse

2009-05-07 Thread Romain Charbit
Hi,

Thanks for your answers. I've done some further tests on my 3D scene. So the 
Line intersections takes about 20ms in a 460k triangles scene for me. I tried 
to enable Kdtree. I just put :


Code:

osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES);



And Magic! It now takes about 0.8 to 1 ms. Definitly what I want for a real 
time app :D

Thank you!

Cheers,
Romain Charbit


Romain Charbit

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





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


Re: [osg-users] Change cursor with object under mouse

2009-05-06 Thread neil.hughes
Hi Romain,

The way I did this was with a custom PickHandler. If you look at the 
PickHandler example - I think its the scribeFX one - you basically get the 
mouse events coming in. It gives you an opportunity to do your line 
intersections to determine the object under the mouse, at which point you can 
decide what cursor you wish to change to. 

Hope this helps.

Neil.


 Romain Charbit  wrote: 
> Hi,
> 
> May I ask your guidance for a problem that I have.
> 
> I want to change the cursor of the mouse in function of the object that is 
> under of it. Example, when I'm passing the mouse over a dragger, I want to 
> change the cursor to a Hand.
> 
> I'm on the detection of the object for the moment. I'm using a handler which 
> use a LineSegmentIntersector on every frame. It works but it's kind of slow.
> 
> I've seen on the web about the GL_SELECT OpenGL renderMode which has been 
> design for it. But I've also seen that it's not a good way to do that. 
> 
> Maybe someone has already done something like this or has an idea about it?
> 
> 
> Thank you!
> 
> Cheers,
> 
> Romain Charbit
> 
> 
> Romain Charbit
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=11520#11520
> 
> 
> 
> 
> 
> ___
> 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] Change cursor with object under mouse

2009-05-06 Thread Robert Osfield
Hi Romain,

OpenGL selection is far slower than using CPU based ray intersections,
as it requires a round trip to the GPU, so I certainly wouldn't
recommend this.

Instead I'd recommend looking at why your line intersections are
taking so long to complete.  Most of the models I have I find the
intersection traversal is just quick, and just a 1ms or two even for
quite big models.  Using KdTree's attached to the geometry leaves can
be used to massively speed up intersections so perhaps this is
something worth looking at.

Robert.

On Wed, May 6, 2009 at 5:03 PM, Romain Charbit  wrote:
> Hi,
>
> May I ask your guidance for a problem that I have.
>
> I want to change the cursor of the mouse in function of the object that is 
> under of it. Example, when I'm passing the mouse over a dragger, I want to 
> change the cursor to a Hand.
>
> I'm on the detection of the object for the moment. I'm using a handler which 
> use a LineSegmentIntersector on every frame. It works but it's kind of slow.
>
> I've seen on the web about the GL_SELECT OpenGL renderMode which has been 
> design for it. But I've also seen that it's not a good way to do that.
>
> Maybe someone has already done something like this or has an idea about it?
>
>
> Thank you!
>
> Cheers,
>
> Romain Charbit
>
> 
> Romain Charbit
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=11520#11520
>
>
>
>
>
> ___
> 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