View unanswered posts | View active topics It is currently Thu Oct 17, 2019 7:13 am



Reply to topic  [ 13 posts ]  Go to page Previous  1, 2
 primitive selection 
Author Message
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post 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);


@+


Thu Jan 20, 2011 9:44 am
Profile

Joined: Thu Oct 28, 2010 10:55 pm
Posts: 17
Post Re: primitive selection
Thanks very much, it is working now as expected, you are a genius:)


Thu Jan 20, 2011 6:45 pm
Profile
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post Re: primitive selection
:oops:


Thu Jan 20, 2011 7:52 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.