If you want to move the selected object around on a plane (which sounds like what you want to do), then you can do a simple ray/plane intersection test and get the world coordinates from that. For example, if your object is at [5 3 8] and you want to move it on the z-plane, then you just use the ray from camera through mouse cursor and intersect it with the plane at [0 0 1 8]. Ray/plane intersection maths is fairly trivial, and a quick Google will turn up any number of solutions. Indeed, I'm sure poking around the OSG code withh turn up a version.
John Donovan Sony Computer Entertainment Europe http://www.scee.com [EMAIL PROTECTED] wrote on 06/12/2006 14:45:12: > > someone? > I realy need to move object in the scene with the mouse.. > there maby onother way to do so? > > thanks > NB > On 12/5/06, benny porat <[EMAIL PROTECTED]> wrote: > thanks > the intersection now work fine, > but I still have the problem that I need to use the function: > computeNearFarPoints > I need this function to compute the coordinate of the world with > specific z value, that correspond to (x,y) on the screen, > so I can know how much to move the object. > (I need to know when the mouse move on the screen how much he move > in the world, in a specific z value?) > > how I can do this? > thanks > NB > ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [EMAIL PROTECTED] This footnote also confirms that this email message has been checked for all known viruses. ********************************************************************** Sony Computer Entertainment Europe _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
