[osg-users] Creating shapes under mouse cursor

Andreas Goebel a-goebel at gmx.de
Sun Jan 6 05:10:22 PST 2008


Renan Mendes schrieb:
> In 3d coordinates... I know, we'll have to do something about the depth.
>
> Renan M Z Mendes
> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>   
Hi Renan,

what I do for this is the following:

- compute the line behind the mouse cursor perpendicular to the screen. 
You will ned the transformation and view matrices for this

- intersect this line with a plane parallel to the screen through the 
origin. You can use the line computed before as a normal vector for this 
plane

The intersection gives a point that is
a) behind the mouse
b) as close to the origin as possible

The choice for the depth might be another, but this one makes sense in 
some way!

Regards,

Andreas



More information about the osg-users mailing list