Re: [osg-users] Labeling 3D Nodes with HUD style
The code I suggested you look is still pretty relevant you just have to work the algorithms around a bit Do a google on glUnProject and glProject, this is not a new topic :) Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Hagen Sent: Wednesday, April 01, 2009 10:11 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Labeling 3D Nodes with HUD style Thank you for the fast reply. But I need the exact opposite of mouse picking. I want to know the 2d Coordinates given the 3D Coordinates. So a kind of reverse picking :-) Thx Hagen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9539#9539 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Labeling 3D Nodes with HUD style
Thank you for the fast reply. But I need the exact opposite of mouse picking. I want to know the 2d Coordinates given the 3D Coordinates. So a kind of reverse picking :-) Thx Hagen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9539#9539 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Labeling 3D Nodes with HUD style
Have a look through the Picking code and examples this shows you how to transform the 2d window coordinates ( in this case were the mouse is, but the principle is the same) into 3d scene coordinates Once you have the coordinates then straight forward to draw a line or any thing your want , We do this for callout type box that can track objects, points etc, ( sorry I'm not able to provide code on how we do this) Gordon Product Manager 3d __ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __ -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Hagen Sent: Wednesday, April 01, 2009 9:40 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Labeling 3D Nodes with HUD style Hi, Im trying to label certain points in my 3D - Scene. Of course I could just use osgText and add it to a transform. But what i want to do is a little more complicated. I want to draw rectanlges with text inside that are drawn 2D (HUD like) on the screen. They shall only appear on near the border of the screen. But now (the tricky thing) I need to draw a line or sth. from the 2D Rectangle to a certain point in the scene that is given by 3D coordinates. How do i do that? I must somehow find out where on the screen my 3D-Point appears. Or is there another way? Thank you. Hagen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9536#9536 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Labeling 3D Nodes with HUD style
Hi, Im trying to label certain points in my 3D - Scene. Of course I could just use osgText and add it to a transform. But what i want to do is a little more complicated. I want to draw rectanlges with text inside that are drawn 2D (HUD like) on the screen. They shall only appear on near the border of the screen. But now (the tricky thing) I need to draw a line or sth. from the 2D Rectangle to a certain point in the scene that is given by 3D coordinates. How do i do that? I must somehow find out where on the screen my 3D-Point appears. Or is there another way? Thank you. Hagen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9536#9536 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org