GLC_lib & GLC_Player Forums
http://www.forum.glc-lib.net/

primitive selection
http://www.forum.glc-lib.net/viewtopic.php?f=4&t=128
Page 2 of 2

Author:  laumaya [ Thu Jan 20, 2011 9:44 am ]
Post subject:  Re: primitive selection

Hi, it's clear now,
jeffer wrote:
When I pick/select the line created above, sometimes it give the correct selectionID using the OpenglView::select() in GLC_player, sometimes the selectionID is not correct. Could you please give some details how to use GLC_3DViewCollection for the geometries I want to select? Thanks.

It seems that there is no problem in your code. I think that the problem com from anti-aliasing...

In GLC_lib, the selection of object is done by rendering the scene off-screen with specific color for each 3DViewInstance.
It's work fine with solid object. But, if anti-aliasing is on, the color of wire object is blended with the background color (Black) and border of a white wire become grey :? So the grey color is decoded and a wrong id is return.
As I know, when using Qt4 in OpenGL application, there is two way to activate anti-aliasing :
    With the graphic driver
    Within the application
If you use the first one you have to deactivate it. But the render will be aliased :(
If you use the second one, you just have to deactivate it in your code when you render in selection mode.
Something like that in the paintGl method:
Code:
      if (!GLC_State::isInSelectionMode()) glEnable(GL_MULTISAMPLE);
      else glDisable(GL_MULTISAMPLE);


@+

Author:  jeffer [ Thu Jan 20, 2011 6:45 pm ]
Post subject:  Re: primitive selection

Thanks very much, it is working now as expected, you are a genius:)

Author:  laumaya [ Thu Jan 20, 2011 7:52 pm ]
Post subject:  Re: primitive selection

:oops:

Page 2 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/