thanks for reply ..
sorry for the source code i posted ...i didnt knew bout it...
and yeah
@ above .. thanks for your reply .. it worked for grid

.. but the problem of gui elements is still remaining ... by gui element i meant the menu at the top... when i click the scene then the current active camera is kindda bound to screen and i cant select anything else

..
what i did is :
in global i declared these :
Code: Select all
ISceneNode* nodeSelected=0;
ISceneNode* prevNodeSelected=0;
then in main loop :
Code: Select all
while(mainDevice->run()){
if(mainDevice->isWindowActive()){
//vidDriver->beginScene(true,true,SColor(255,255,255,255));
vidDriver->beginScene((bool)v3s.backBuffer,(bool)v3s.zBuffer,SColor(v3s.bgAlpha,v3s.bgRed,v3s.bgGreen,v3s.bgBlue));
//selection of nodes
core::line3d<f32> ray;
vector3df intersection;
triangle3df hitTriangle;
nodeSelected=0;
ray = mainDevice->getSceneManager()->getSceneCollisionManager()->getRayFromScreenCoordinates(mainDevice->getCursorControl()->getPosition(),mainDevice->getSceneManager()->getActiveCamera());
nodeSelected = mainDevice->getSceneManager()->getSceneCollisionManager()->getSceneNodeAndCollisionPointFromRay(ray,intersection,hitTriangle,0,0);
//
// draw if window is active
mainSceneManager->drawAll();
//mainDevice->getCursorControl()->setVisible(false);
sceneHandler1.draw3DGrid();
iEnv->drawAll();
//handler1.draw2DGrid(v3s.winWidth,v3s.winHeight,2,false,SColor(255,255,255,255),SColor(255,255,255,255));
activeCam = mainDevice->getSceneManager()->getActiveCamera();//get active camera
mainDevice->getGUIEnvironment()->drawAll();
mainDevice->setWindowCaption(sfn.c_str());
//driverInfoBox
handler1.drawDriverInfoBox();
vidDriver->endScene();
}
else{
mainDevice->yield();
}
};
and in event receiver :
Code: Select all
if(events.EventType == EET_MOUSE_INPUT_EVENT){
if(events.MouseInput.Event == EMIE_LMOUSE_LEFT_UP){
if(nodeSelected)
{
nodeSelected->setDebugDataVisible(EDS_BBOX);
prevNodeSelected=nodeSelected;
}
else
{
if(prevNodeSelected){
prevNodeSelected->setDebugDataVisible(EDS_OFF);
}
}
return true;
}
return false;
}
and also i have added cameras array cam[3] one of which is maya another fps and further one is simple camera scene node.. when i click the model , it gets selected but the menu at the top gets disabled or something similar ..
