Forum archiveIssue archiveVisualization and 3D Viewer

Archived discussion

Background Gradient

Visualization and 3D ViewerSun, 10/21/2018 - 07:4110 replies

Browse this forum
QuestionAuthor

Good day.

I have a problem with using background gradient.
You can see it in the picture.

I have 2d XY-rectangle instead background.
I use Ubuntu, Qt widget. What can it be?

 
 

Discussion

10 archived replies

Posts are displayed in their archived order.

01Commenter-1

So what exactly wrong on your screenshot?

02Author

I mean, it should look like a background gradient. Like background in freecad.
And its display should not depend on the rotation of the camera.
I expect this behavior.

occ-> m_view-> SetBgGradientColors (
Quantity_Color (0.5, 0.5, 0.5, Quantity_TOC_RGB),
Quantity_Color (0.3, 0.3, 0.3, Quantity_TOC_RGB),
Aspect_GFM_VER,
Standard_True
);

And earlier, in Ubuntu 16.04, it worked with the occt7.2 kernel.
After switching to Ubuntu 18.04, something has changed, but I'm not sure that the problem is in the operation system.

Correct background on attached screenshot.

03Commenter-1

Which version of OCCT you are using?
Did you build it yourself, or configured some Launchpad repository?

04Author

I tried 7.2.0, 7.3.0, which are compiled by myself, and version occt from ubuntu apt-get repo (libocct-*-7.3).

05Author

Sorry... experiment with ubuntu rep was failed. In realy it was libraries compiled by myself in all variants....

06Author

But it really doesn't work with libocct-*-7.3 from apt. The bug remains unchanged

07Commenter-1

Have you tried localizing the issue?
Try disabling the code displaying any other object in 3D Viewer to see if something is triggering the issue.

Gradient background is used by many OCCT applications, so that there should be something different in your test case...
If you have built OCCT with Draw Harness, then the following simple test script should display a correct background:

pload MODELING VISUALIZATION
box b 1 2 3
vclear
vinit View1
vdisplay -dispMode 1 b
vfit
vzbufftrihedron
vsetgradientbg 255 0 0 0 0 255 2
08Author

have done
I think this is not what I should have seen.

09Author

If i set background early ```vfit``` command, it looks correct. But after ```vfit``` it breaks.
In my app, i have the correct gradient if list of shapes is empty. But box(1,1,1) broke it.

10Author

Now it seems like...