For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Drawing overlay

roy roy's picture
Forums: 

Hi,

I 'am a new opencascade user.

I would like to draw 3d items over the opencascade rendering like a NavCube.
I do the rendering like opencascade examples (with AIS) in a QOpenGLWidget.
I try something like this:

void CadRenderWidget::paintGL()
{
    draw();// call Handle_V3d_View::Redraw

    if(m_pNavCube)// draw the NavCube
        m_pNavCube->draw();
}

But my nav cube is not drawn. If I comment the first line, the opencascade scene
is always displayed, I have no control on rendering.
So I' am on the wrong way.

My truly questions are:
* How drawing 3d objects over the scene (= without Z order)?
* How drawing 3d objects like an HUD ?

Thanks,
Sorry for my english.

Kirill Gavrilov's picture

I don't know what m_pNavCube->draw() does, but I suppose this is something external OpenGL rendering code.
Mixture of low-level renderers is possible, but it is a tricky matter, so that you should try first using OCCT native tools before going outside.

For auxiliary elements like HUD, OCCT provides ZLayers like Graphic3d_ZLayerId_Topmost and Graphic3d_ZLayerId_TopOSD defining rendering order and depth buffer state,
as well as Graphic3d_TransformPers defining unusual object behavior in 3D viewer like placing it in the corner as trihedron or drawing 2D on-screen elements.