Hi openSG users,
i am working on a client server application. One of the features
that I am trying to implement, relies on the mouse interaction with the
server side scene. I thought about introducing a "virtual" 3d mouse hovering
in front of the user, piloted in the client side.
Since in previous projects I used often the opensg picking example I thought
about using the same principle on the viewport belonging to the
MultiDisplayWindow I am using:
osg::CameraPtr camera = m_pClientRenderModule->getMainCamera ();
osg::Line line;
camera->calcViewRay (line, posX, posY,
*m_pClientRenderModule->getMainViewPort().getCPtr());
osg::Pnt3f point;
m_pCursorPlane.intersect (line, point);
setCursorPosition (point);
to check the intersection I simply intersect the unprojected line with a
plane normal to the At-From vector.
The code is working, except from some weird coordinates problems. I thought
that the cursor would have behaved like a normal mouse pointer, with
coordinates ranging from 0,0 (upper left pixel) to winWidth, winHeight.
Instead, no matter what size I give to the MultiDisplayWindow, I can't get
the "mouse coordinates" match the window dimensions (usually the 0,0 point
in in the mid of the server window).
Any hints on what I am doing wrong?
Thanks,
E.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users