  | | | Mouse coordinates in world space | Mouse coordinates in world space 2003-11-20 - By Julie Anne Mayfield
Back Hey Silvio You'll want to use event.getWindowPosition. That will give you the mouse location in your viewport. Then you have to figure out your location of the mouse in view coords (ie flip your y coords. These functions conflict. One has the y at 0 in top left, the other in bottom left or something like that). Then you can use the M3dView function viewToWorld. This will give you a vector and a point shooting out from your viewport in the direction of the mouse.
-Julie Anne
--- Silvio Terra <terrasi@(protected)> wrote: > Hi. > > I know that I can get the screen coordinates of the > mouse with > event.getPosition( curSample->x, curSample->y); > (curSample is just my own data structure) > but I was wondering how can I get the world > coordinates of where the > mouse would be pointing at. Even a vector pointing > inside the screen > would be OK, since I would be using this mostly for > orthographic views, > and as such, would not have a hard time computing > the point of > intersection with any planes. > > Thanks, > > Silvio > > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- > List-help: > <mailto:listar@(protected)?Subject=help> > List-archive: > <http://www.highend3d.com/maya/devarchive/> >
__ ____ ____ ____ ____ ____ ______ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|
 |