Re: [eq-dev] mouse pick

0 views
Skip to first unread message

Stefan Eilemann

unread,
Sep 20, 2010, 4:21:42 AM9/20/10
to eq-...@equalizergraphics.com

On 8. Sep 2010, at 11:41, Aren [via Software] wrote:

> Hi,
>   I want to add mouse pick(select an object after click) support to  
> my application, but I confuse about where to add intersecting code.
>
> First I try to add it to Config::handleEvent(), but failed, because  
> intersecting needs viewport and  projection matrix (I call glGet to  
> get them)which are empty or not initialized yet.

I tend to avoid glGet wherever possible. For this code you don't need  
them since you have all the data in the event itself. See the attached  
(quick&dirty) patch for doing the picking locally in the Channel. This  
code can (and should) easily be placed in Config::handleEvent.

> Then I remove them to Channel::processEvent(), it can do  
> intersecting correctly. In my FrameData, there's an objectID refer  
> to selected object. After  intersecting , I reset objectID in  
> FrameData. But it seems client nodes
> haven't get the new objectID.

The client-side FrameData object is never committed, since the master  
instance is on the application. Therefore the clients never get  
updated. Do the event handling in Config::handleEvent and things  
should be fine.


Cheers,

Stefan.




pick.diff (3K) Download Attachment


View this message in context: Re: mouse pick
Sent from the Equalizer - Parallel Rendering mailing list archive at Nabble.com.

praktikant

unread,
Jun 9, 2012, 3:47:56 AM6/9/12
to eq-...@equalizergraphics.com
Hi,

I had a look at the "quick&dirty" Channel::processEvent() function, which
should be moved to Config::handleEvents(). But how can I access the
frameData from the Config class, and how can I make sure that I obtain the
right frameData (the one from the channel where the mouse event took place)?


Thanks :)

--
View this message in context: http://software.1713.n2.nabble.com/mouse-pick-tp5509857p7580340.html
Sent from the Equalizer - Parallel Rendering mailing list archive at Nabble.com.

_______________________________________________
eq-dev mailing list
eq-...@equalizergraphics.com
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com

Stefan Eilemann

unread,
Jun 11, 2012, 3:00:50 AM6/11/12
to eq-...@equalizergraphics.com

On 9. Jun 2012, at 9:47, praktikant [via Software] wrote:

> I had a look at the "quick&dirty" Channel::processEvent() function, which should be moved to Config::handleEvents(). But how can I access the frameData from the Config class, and how can I make sure that I obtain the right frameData (the one from the channel where the mouse event took place)?

I suggest you do the reprojection (generating the pick ray) in Channel::handleEvent, send a custom ConfigEvent containing the pick ray to the application and do the ray/scene intersection when handling the event in Config::handleEvent.


HTH,

Stefan.



--
View this message in context: http://software.1713.n2.nabble.com/mouse-pick-tp5509857p7580383.html
Reply all
Reply to author
Forward
0 new messages