[osg-users] OSG world coordinates to 2D screen coordinates
Hi, I'm using OSG as part of a VR software package and I'm trying to implement picking with a 6DOF tracking system. I'm having trouble finding a way to convert the position of my tracking object (right now just a sphere) from its world coordinates to screen coordinates so I can use the xy coordinates to pick with. I'm porting my environment over from a normal monitor setup (where I can use a mouse for picking and already have all the code written) to a 3 sided cave setup where a mouse does not work. Im thinking of a hacky way to do it that I think would work if I knew how osg normalized mouse coordinates with osg::GUIEventAdapter::getXnormalized(), but I cannot for the life of me find the code for that function. If anyone knows of a method to convert world coordinates back to screen coordinates without having to totally reimplement my picking system, that would be great. If anyone can point me to the code for getXnormalized or the method used (I've found some - but they don't lead to the exact same result), that would be great as well. Thanks! Luke -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30194#30194 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG world coordinates to 2D screen coordinates
Thanks a lot Jean, that was exactly what I needed. I actually read this first thing this morning but was so excited to get started on it I forgot to reply and thank you. Luke -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30225#30225 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG world coordinates to 2D screen coordinates, reverse picking
Hi, I'm using OSG as part of a VR software package and I'm trying to implement picking with a 6DOF tracking system. I'm having trouble finding a way to convert the position of my tracking object (right now just a sphere) from its world coordinates to screen coordinates so I can use the xy coordinates to pick with. I'm porting my environment over from a normal monitor setup (where I can use a mouse for picking and already have all the code written) to a 3 sided cave setup where a mouse does not work. Im thinking of a hacky way to do it that I think would work if I knew how osg normalized mouse coordinates with osg::GUIEventAdapter::getXnormalized(), but I cannot for the life of me find the code for that function. If anyone knows of a method to convert world coordinates back to screen coordinates without having to totally reimplement my picking system, that would be great. If anyone can point me to the code for getXnormalized or the method used (I've found some - but they don't lead to the exact same result), that would be great as well. Thanks in advance! I posted this to the forum, but after a couple hours, my post hasn't even been approved yet (my first OSG post), so I figured I'd give the mailing list a try. Luke ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org