Picking

15 views
Skip to first unread message

Drew

unread,
Sep 17, 2011, 10:01:41 AM9/17/11
to PhiloGL
So I'm trying to understand picking, I decided on load to just pick
something and noticed odd things happening on the scene and/or
camera. Should picking be done on a separate scene instead of the
main one? I thought well this is useless anyways and hooked it up in
a onMouseMove event, thinking I can create an arrow pointing to the
various graphs and show their x/y values.

Here's a screenshot showing my problem:

The code, model always returns undefined:
onMouseMove: function( e ){

var model = this.scene.pick( e.x, e.y );
console.log( model );
}

http://gyazo.com/50814ab8d4d50b6b88a2d02c9422d55c

I may be misunderstanding the pickable property, I set pickable to
true in my setupElement() (so it runs every tick) still seeing the
same odd behavior when onMouseMove fires.

Drew

unread,
Sep 17, 2011, 10:33:36 AM9/17/11
to PhiloGL
I'm setting pickable true on my models at instantiation, before or
after adding them to the scene. I still get false everytime I try to
pick from them. Could there be some bugs in version 1.3.0? Using
Win7/FF7

Nicolas Garcia Belmonte

unread,
Sep 17, 2011, 11:18:04 AM9/17/11
to phi...@googlegroups.com

Yes, I noticed a bug in Windows -although I'm not sure you're using the picking method correctly. I just took a windows laptop from work to see if I can debug what's happening this weekend. I'll keep you posted.

Drew

unread,
Sep 17, 2011, 9:31:03 PM9/17/11
to PhiloGL
I don't think I'm using it right either. I'll try the code on Linux
see if something is off.

On Sep 17, 11:18 am, Nicolas Garcia Belmonte <phil...@gmail.com>
wrote:
> Yes, I noticed a bug in Windows -although I'm not sure you're using the
> picking method correctly. I just took a windows laptop from work to see if I
> can debug what's happening this weekend. I'll keep you posted.

Drew

unread,
Sep 17, 2011, 10:48:10 PM9/17/11
to PhiloGL
Yeah the weird stuff is related to Windows. Although the state of my
intel graphics drivers leave much to be desired.

Drew

unread,
Sep 19, 2011, 10:35:07 PM9/19/11
to PhiloGL
Hmm, so I did get pickable turned on correctly and enabled picking as
part of my default events object passed to PhiloGL. My models seem to
be tracking the mouse now (even with all event handlers disabled).
I'm checking camera.position and this.scene.models[0].position and not
seeing their x/y change, but they are definitely moving on the
screen. This stops when I turn event.picking = false.

Chromium13/ FF7 Ubuntu 11.10

I don't know I guess I'll try out your picking example, this seems
very odd though.

ashgavs

unread,
Sep 22, 2011, 7:51:46 PM9/22/11
to PhiloGL
Is whats going on that the graph shrinks on the y axis when you move
the mouse? I had this same problem on Windows as well, in addition to
my other problems listed here:

http://groups.google.com/group/philogl/browse_thread/thread/50a7725dbd40f8c

On Sep 17, 10:01 am, Drew <drew.well...@gmail.com> wrote:

Nicolas Garcia Belmonte

unread,
Sep 23, 2011, 8:22:10 PM9/23/11
to phi...@googlegroups.com
There's only one problem with picking AFAIK, and it's whether you're
using windows or not. This can be seen in the picking example in the
library under the examples folder. I just fixed the picking example in
windows. Tested windows and mac and both work with this build of the
framework:

https://github.com/philogb/philogl/blob/master/build/PhiloGL.js

I will be doing some other optims I had previewed before a 1.3.1
release, but that build already fixes the picking for windows. Try the
picking example with that new build and you'll see on win and mac that
this works correctly.

--
Nicolas Garcia Belmonte - http://philogb.github.com/

Reply all
Reply to author
Forward
0 new messages