Mon, 02/25/2008 - 12:20
i made some modifications to the OCC sources. It is possible to set an upper and a lower background color in v3d_view to have a nice opengl gradient background. (It is also possible to set a single background color as usual). If someone is interested, i coud publish the diff.
Mon, 02/25/2008 - 17:23
I am interested, please!
Mon, 02/25/2008 - 17:48
I am interested too.
Tue, 02/26/2008 - 01:47
You can do it using the V3d_View call back feature without changing the occ sources.
Actually I did change the source to run the call back higher up in the rendering code - but only to fix colorscales / blending.
Still interested to see your code.
Tue, 02/26/2008 - 02:51
Hello, Pete! I've tried your code from QtOCC, but something went wrong. In the view was displayed only the gradient and no objects. Nevermind, when I have enough time, I'll continue and fix it. Regards!
Tue, 02/26/2008 - 09:02
The gradient code works on all platforms. The latest versions of qtocc are available in SVN - see http://sourceforge.net/projects/qtocc . Whilst we are integrating Fotis' GEOM port from Salome, the widget hasn't changed much - apart from its class name.
Tue, 02/26/2008 - 10:59
Here's a tip that might help. When you create your Viewer (not View) set the z-buffer auto management fo false, similar to
// Create the OCC Viewers
TCollection_ExtendedString a3DName( "Visual3D" );
myViewer = createViewer( "DISPLAY", a3DName.ToExtString(), "", 1000.0 );
myViewer->SetZBufferManagment( Standard_False ); // <- THIS LINE HELPS!!
Sun, 08/03/2008 - 19:51
Hi, Pete! If you're reading this, may I ask you (or someone who knows) how to make the gradient working for transparent objects too? What I have to fix?
Mon, 08/04/2008 - 19:54
You could try using my Open CASCADE patch to the OpenGl rendering call back - I seem to remember that it fixed many of the problems related to transparency. I've started putting all my OCC patch collection into the QtOCC svn repository on sourceforge.
The relevant changes can be seen in the difference list shown here
You'll need to recompile the TKOpenGl library. Let me know if this helps.
Mon, 08/11/2008 - 19:29
Thanks, I've applied the patch rev.72 and the transparency now looks better, but still something seems wrong. See on the screenshot: http://img150.imageshack.us/my.php?image=transparencytu2.png
The sphere is black, 10% transparent. The bigger box is green, 10% transparent. The little box is opaque. I think the blending is not done correctly. For transparent objects only the areas in front of other opaque objects (and grid) are blended correctly.
Tue, 08/12/2008 - 12:45
Hi, the transparency problem has been fixed with changing the blending function. I've borrowed the code from a recent thread in the forum. I mean:
// if (myView->ColorScaleIsDisplayed())
/* Not needed on patched OCC 6.2 versions, but is the lowest
common denominator working code on collaborators OpenGL
// glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
And the result is:
But there's another problem, which is related to OCC, not the gradient callback itself. When the green box' display mode or transparency is changed, the green box "pops up" even if there is another object above it. Look here:
Do you know what causes the display priorities to go wrong?
Tue, 08/12/2008 - 21:31
I was going to suggest that you look at the bleanding function, but you beat me to it. The problem I was running into was that I was getting different effects on different graphice cards when displaying the "colorscale". If you're not using this feature then the blending function you're using now should be OK.
Unfortunately at work, the picvalley site is a prohibited site, so I'll try to take a look at home on my own kit.
Sat, 08/16/2008 - 10:04
I am interested to see the diff of the work you did. Can you kindly publish it or mail it to firstname.lastname@example.org
Thanks and Regards