Page 1 of 1

draw 3D object overlaying the scene

Posted: Wed Oct 29, 2014 10:00 am
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

Re: draw 3D object overlaying the scene

Posted: Wed Oct 29, 2014 10:10 am
by hendu
To draw it on top, disable its depth test.

Re: draw 3D object overlaying the scene

Posted: Wed Oct 29, 2014 10:51 am
by rebelpn
Thank you! It was really that easy :)