Hi Robert,
Robert O wrote:
> Hi!
>
> (OSG1.8 VS)
>
> I have created a graph without the SimpleSceneManager and placed a HUD
> as a child of the cameraBeacon.
> If I do an intersectiontest, starting at the HUD Node no Objects are
> hit!
>
> void mouse(int button, int state, int x, int y)
> {
> if (state){
> Line ray = SceneManager::calcViewRay(x, y);
> IntersectAction *iAct = IntersectAction::create();
> iAct->setLine(ray);
> iAct->apply(HUD::getHUDroot());
> if (iAct->didHit())
> std::cout<<"did hit"<<std::endl;
> }
> }
>
> Does anybody know the problem?
I have a hunch: I'm assuming your HUDroot is not the root of the
scenegraph, but somewhere lower? In that case the ray needs to be in the
same coordinate system as the node that you're starting it at.
To fix this you can either use the traversal mask to limit the action to
the subgraph of the HUD, or explicitly transform the line into the HUD
coordinate system.
Hope it helps
Dirk
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users