Forums > Jitter

Report a Click on a Given Slab

April 30, 2007 | 9:27 am

Hi,

Just wondering if anyone knows if there is a way to detect if a slab has been clicked.

If multiple slabs exist at any given time, report back which slab was under the mouse cursor when the left mouse button was clicked.

I have tried doing this by converting the position of the slab from its float OpenGl aspect ratio position to a simple XY Co-ordinate positon and then comparing it to the mouse Idle postion reported back from my PWindow but it does not seem to provide accurate enough results.

Does anyone know if it is possible to detect which slab is directly underneath a mouse click or know of any documentation that I could refer to, to learn more about the slab positioning systems in OpenGL (for the lay-man).

Cheers

Andy


April 30, 2007 | 12:49 pm

maybe check out jitterhittest-example.pat in
examples/jitter-examples/javascript/ui/

On 4/30/07, Andy Brennan wrote:
>
>
> Hi,
>
> Just wondering if anyone knows if there is a way to detect if a slab has
> been clicked.
>
> If multiple slabs exist at any given time, report back which slab was
> under the mouse cursor when the left mouse button was clicked.
>
> I have tried doing this by converting the position of the slab from its
> float OpenGl aspect ratio position to a simple XY Co-ordinate positon and
> then comparing it to the mouse Idle postion reported back from my PWindow
> but it does not seem to provide accurate enough results.
>
> Does anyone know if it is possible to detect which slab is directly
> underneath a mouse click or know of any documentation that I could refer to,
> to learn more about the slab positioning systems in OpenGL (for the
> lay-man).
>
> Cheers
>
> Andy
>


April 30, 2007 | 1:51 pm

Thats pretty much what I’m going for. I haven’t used any js stuff before so I’ll experiment with interest.

Thanks

Andy


Viewing 3 posts - 1 through 3 (of 3 total)