Re: [osg-users] 3D mice

26 views
Skip to first unread message

Thomas Lerman

unread,
May 17, 2013, 10:12:11 PM5/17/13
to osg-...@lists.openscenegraph.org
I am finally getting back to this (you know, priorities). I have VRPN compiled on my computer. However, it would appear that the 3DConnexion SpaceMouse Pro might not be supported?

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





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

Chris Hanson

unread,
May 18, 2013, 3:01:54 PM5/18/13
to OpenSceneGraph Users
In my experience the serial-port-based Spaceball type devices can be made to work. The USB-based ones require driver interaction in a way I couldn't get to work.
--
Chris 'Xenon' Hanson, omo sanza lettere. Xe...@AlphaPixel.com http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

Thomas Lerman

unread,
May 18, 2013, 3:09:03 PM5/18/13
to osg-...@lists.openscenegraph.org
I found this morning that the SpaceMouse Pro was not implemented in VRPN, so I ended up implementing it and sending it back to the repository. I have it and osgWorks working now. Now to see how well I can integrate the whole thing into my project. This probably is really out of the OpenSceneGraph scope.

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

Jan Ciger

unread,
May 19, 2013, 7:10:54 AM5/19/13
to osg-...@lists.openscenegraph.org
On 05/18/2013 09:09 PM, Thomas Lerman wrote:
> I found this morning that the SpaceMouse Pro was not implemented in VRPN, so I ended up implementing it and sending it back to the repository. I have it and osgWorks working now. Now to see how well I can integrate the whole thing into my project. This probably is really out of the OpenSceneGraph scope.

Hi,

I am the original author of the 3DConnexion drivers in VRPN. I had only
the regular SpaceNavigator, so couldn't support the others except for
adding the USB vid/pid pair (no hw to test it on). However, I think that
the protocol is pretty much the same for the rest, except for buttons
and displays for the devices that have those. Thus it shouldn't be too
hard to add.

Thanks for sending the patch in!

Re serial devices - those should be supported by VRPN already (like the
old SpaceBall).

Regards,

Jan

Thomas Lerman

unread,
May 20, 2013, 9:43:02 AM5/20/13
to osg-...@lists.openscenegraph.org
Yeah, it was no big deal. I did check out osgWorks and osgVRPN (part of osgToy). The only thing is it appears osgVRPN is on an old version of osg (2.2).

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

Jan Ciger

unread,
May 20, 2013, 10:18:56 AM5/20/13
to osg-...@lists.openscenegraph.org
On Mon, May 20, 2013 at 3:43 PM, Thomas Lerman <osgf...@tevs.eu> wrote:
> Yeah, it was no big deal. I did check out osgWorks and osgVRPN (part of osgToy). The only thing is it appears osgVRPN is on an old version of osg (2.2).

It is likely simpler to just instantiate your vrpn_TrackerRemote and
make an update callback on the OSG node that you want to drive with
the 3D mouse pull the data from VRPN. Perhaps 10-15 lines of code and
no additional dependency (apart from VRPN).

Regards,

Jan

Chris Hanson

unread,
May 20, 2013, 10:29:41 AM5/20/13
to OpenSceneGraph Users
osgVRPN does has some nice convenience code, which is really its main purpose.

I'm sure Mike would love some help updating the osgVRPN build.

Thomas Lerman

unread,
May 20, 2013, 10:25:53 AM5/20/13
to osg-...@lists.openscenegraph.org
Thank you Jan. I will have to check it out. I will take a look at the tutorial you mentioned previously to see how to do that (I presume that is where you would suggest looking). It would be great if it is 10-15 lines of code, no additional dependencies other than VRPN, and creates nice & smooth movements. Any other hints (I am rather limited on time, so anything is appreciated)?

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

Jan Ciger

unread,
May 20, 2013, 10:46:46 AM5/20/13
to osg-...@lists.openscenegraph.org
Hello Thomas,

On Mon, May 20, 2013 at 4:25 PM, Thomas Lerman <osgf...@tevs.eu> wrote:
> Thank you Jan. I will have to check it out. I will take a look at the tutorial you mentioned previously to see how to do that (I presume that is where you would suggest looking). It would be great if it is 10-15 lines of code, no additional dependencies other than VRPN, and creates nice & smooth movements. Any other hints (I am rather limited on time, so anything is appreciated)?

There is a simple (non-osg-specific) VRPN tuto here:

http://www.vrgeeks.org/vrpn/tutorial---use-vrpn

A callback to update a matrix on an osg::MatrixTrasform from the
quaternion/vector that you get from VRPN is just a copy & paste from
an example in OSG. Or, even simpler, you can do it from the VRPN
callbacks directly, just retrieve the data you want and set it to the
node's matrix.

Just don't forget to run the mainloop() function during the update
traversal of the scenegraph - that is when the above mentioned
callbacks get actually called if there are new data from the VRPN
server. That can be done either in an update callback on some node
somewhere or if you don't mind a bit of a mess in your code, put it in
the main loop, somehow like this:

while (!viewer.done())
{
tkr->mainloop();
viewer.frame();
}

That's pretty much all there is to VRPN on the client side. The other
classes (Button, Analog, Dial, etc.) work pretty much the same - open
a remote, register a callback and then call the mainloop() on the
remote.

Regards,

Jan

Aric Aumann

unread,
May 20, 2013, 4:18:45 PM5/20/13
to osg-...@lists.openscenegraph.org
There was an osgVRPN update from Will Hollingsworth last summer, it worked with OSG 3+

See:

IIRC, to get Mike Weiblen's last commit compiling against OSG 3, the main thing is to change TrackerManipulator's base class from the MatrixManipulator to CameraManipulator - post back here if that doesn't do it, and I'll see if I can figure out what else it took.

Once you have that going, you should be able to just use a TrackerManipulator to navigate your scene as shown in the osgVRPNviewer.cpp example, and set up your VRPN config to use your 3dConnexion device as pseudo-tracker (vrpn_Tracker_AnalogFly) - the navigator_usb.cfg in the osgVRPN does exactly that.

The Hollingsworth branch adds the typical VR navigation functions to translate or rotate in user space and a "walled mode" for use on a fixed screen, but I think if all you have is your 3D mouse, you will be fine with the previous version and the pseudo-tracker, which essentially does the navigation on the VRPN side instead of the OSG side.

Hope that helps,
Aric



From: Thomas Lerman <osgf...@tevs.eu>
To: osg-...@lists.openscenegraph.org
Sent: Monday, May 20, 2013 10:25 AM
Subject: Re: [osg-users] 3D mice

Thomas Lerman

unread,
May 20, 2013, 7:21:20 PM5/20/13
to osg-...@lists.openscenegraph.org
Thank you, I will check it out. The difficulty that I see with osgWorks and osgToy is that they seem to maintain their own internal data that is used to set the view matrix. This is problematic for me as I want to still allow mouse and keyboard manipulation of the camera. So far, I have not seen how to basically translate from the current view to a new view based upon the movements of the 3D mouse.

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

Thomas Lerman

unread,
May 20, 2013, 8:01:59 PM5/20/13
to osg-...@lists.openscenegraph.org
Also, I actually really would like to interact with VRPN directly instead of yet another dependency (as Jan stated). I have it working where I see the vrpn_Analog & vrpn_Button classes. I need to take a look at vrpn_Tracker_AnalogFly (as Jan pointed out) to see if that is more useful. As mentioned in a previous post, I still want the regular mouse and keyboard to function whether or not the 3D mouse is attached. Ideally, I would take the current view matrix, pass it into a function to allow VRPN to manipulate it, and set the manipulated matrix as the new current view.

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

Paul Martz

unread,
May 20, 2013, 8:25:28 PM5/20/13
to osg-users
I'm not sure what you want to control with the spaceball, but... I'd like to point out that osgwMx (part of osgWorks) controls a matrix. You can use that matrix for whatever you want, such as controlling a view position or MatrixTransform. So you should be able to use osgGA mouse/kbd to control your view, and use osgwMx/spaceball to control whatever else you want to control. They should be completely independent.
--
Paul Martz
Skew Matrix Software LLC

Thomas Lerman

unread,
May 21, 2013, 12:05:28 AM5/21/13
to osg-...@lists.openscenegraph.org
I do not want the SpaceMouse to be completely independent of the mouse/keyboard control of the view . . . I was to be able to control it with either or both.

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

Thomas Lerman

unread,
May 24, 2013, 1:32:55 AM5/24/13
to osg-...@lists.openscenegraph.org
Incidentally, I have it working using VRPN only and it is insanely cool.

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

Jan Ciger

unread,
May 24, 2013, 4:03:40 AM5/24/13
to osg-...@lists.openscenegraph.org
On Fri, May 24, 2013 at 7:32 AM, Thomas Lerman <osgf...@tevs.eu> wrote:
> Incidentally, I have it working using VRPN only and it is insanely cool.

Hehe :)

Enjoy!

Jan
Reply all
Reply to author
Forward
0 new messages