Dirk Reiners wrote:
        Hi Toni,

On Thu, 2005-10-13 at 22:36 +0200, [EMAIL PROTECTED] wrote:

I´m using the 1.6 release. Will try with a currentbuild.


Please do.


I thought the problem you fixed was related to ortho cameras...


That was just the cause, the effect is more general.

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Do you define your own camera at some point? If you do something like:

pwin = PassiveWindow::create();
pwin->init();

// create the SimpleSceneManager helper
mgr = new SimpleSceneManager;

// create the window and initial camera/viewport
mgr->setWindow(pwin );
// tell the manager what to manage
mgr->setRoot  (scene);

//Create a camera, Could be any type.
cam = MatrixCamera::create();
beginEditCP(cam);
//... whatever that sets up the projection matrix
EndEditCP(cam);

// now change the camera
ViewportPtr vp = pwin->getPort(0);

beginEditCP(vp);
vp->setCamera(cam);
endEditCP(vp);

And later in the picking code use, as you describe:

IntersectAction *iAct = IntersectAction::create();
iAct->setLine(mgr->calcViewRay( x, y ));

This will be where the error is. The reason is that the SimpleSceneManager uses it's internal (perspective) camera for the calcViewRay. It does NOT know about the camera you have set yourself. Instead, you must do:

Line l;
pwin->getPort(0)->getCamera()->calcViewRay(l, x,y, *pwin->getPort(0));

IntersectAction *act = IntersectAction::create();
act->setLine(l);
act->apply(scene);

/Allan


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to