Hello to everyone.
Maybe I'm about to ask a silly question; in this case, excuse me, I'm just a Irrlicht newbie.
I'm implementing a simple CAM utility, something to generate CNC toolpath from 3d meshes.
I'm using some custom scene node and a mesh node, they all are children of the root scene node, and so far so good.
Now I need to render another scene node that must always totally be visible, I mean even if is totally or partially occluded by my other nodes that could be ahead.
This node would be a sort of wireframe placed somehow in a top-most layer; I hope to have explained quite clearly.
Have you suggestions?
I need a sort of top-most 3d layer
Re: I need a sort of top-most 3d layer
if you keep your own pointer to the node in question, you can just draw it last.
begin frame
specialnode->setVisible(false);
smgr->drawAll();
specialnode->setVisible(true);
specialnode->draw();
end frame
begin frame
specialnode->setVisible(false);
smgr->drawAll();
specialnode->setVisible(true);
specialnode->draw();
end frame
-
- Posts: 20
- Joined: Thu May 07, 2015 9:05 am
Re: I need a sort of top-most 3d layer
A piece of cake, it seems!
Many thanks!
Many thanks!
-
- Posts: 20
- Joined: Thu May 07, 2015 9:05 am
Re: I need a sort of top-most 3d layer
Maybe I'm doing something wrong, but it doesn't work, it seems..
the special node is as usual occluded by eventual nodes ahead.
A little note: I used the render() method, because draw() doesn't exist. I don't know if it's an outstanding topic..
the special node is as usual occluded by eventual nodes ahead.
A little note: I used the render() method, because draw() doesn't exist. I don't know if it's an outstanding topic..
Re: I need a sort of top-most 3d layer
The render function is correct. You have to clear the zbuffer (IVideoDriver::clearZBuffer) before drawing that node. If you have more than one node you can also put them in an own scenemanger (ISceneManager::createNewSceneManager) which you render later. That also needs a clear of the zbuffer in between.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: I need a sort of top-most 3d layer
Depending on the type of node, before render() you need to set the scene manager's pass.
-
- Posts: 20
- Joined: Thu May 07, 2015 9:05 am
Re: I need a sort of top-most 3d layer
this is the outstanding element: it works perfectly!CuteAlien wrote:The render function is correct. You have to clear the zbuffer (IVideoDriver::clearZBuffer) before drawing that node. If you have more than one node you can also put them in an own scenemanger (ISceneManager::createNewSceneManager) which you render later. That also needs a clear of the zbuffer in between.
There's no need to make the special node invisible and, after rendered, visible.
Code: Select all
device->getVideoDriver()->beginScene(true, true, SColor(255, 50, 50, 50));
device->getSceneManager()->drawAll(); // "normal" rendered nodes
device->getVideoDriver()->clearZBuffer();
wrkTP->render(); // top-most node
device->getVideoDriver()->endScene();
Many many thanks to everyone!
Re: I need a sort of top-most 3d layer
Ah yes, if you are using newest svn trunk it's deprecated. But will still work for a long time. And the function replacing it might get another change shortly (enum instead of bools).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm