draw 3D object overlaying the scene

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
rebelpn
Posts: 2
Joined: Wed Oct 29, 2014 9:34 am

draw 3D object overlaying the scene

Post by rebelpn »

Hello everyone,

What I'd like to achieve is something similar to Blender's manipulator object. In a nutshell it's a 3D object - actually a set of 3D objects -, that overlays my regular 3D objects, like an on-screen-display. What I've tried so far: I created two empty scene nodes as containers: scene for my normal nodes and osd for the overlaying ones. Between BeginScene() and EndScene() I tried to render them, first scene and then osd as you can see here:

Code: Select all

 
driver->beginScene(true, true, SColor(0,100,100,100));
 
    scene->setVisible(true);
    osd->setVisible(false);
    scene_manager->drawAll();
 
    scene->setVisible(false);
    osd->setVisible(true);
    scene_manager->drawAll();
 
driver->endScene();
 
The two sets are rendered separately as I've expected but unfortunately the overlay effect does not happen, I mean if a node from scene is between a node from osd and the camera, it is drawn over the osd node :(

I'd appreciate any help with this issue.
rebelpn
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: draw 3D object overlaying the scene

Post by hendu »

To draw it on top, disable its depth test.
rebelpn
Posts: 2
Joined: Wed Oct 29, 2014 9:34 am

Re: draw 3D object overlaying the scene

Post by rebelpn »

Thank you! It was really that easy :)
Post Reply