Report a Click on a Given Slab

Apr 30, 2007 at 9:27am

Report a Click on a Given Slab

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

#31669
Apr 30, 2007 at 12:49pm

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
>

#103193
Apr 30, 2007 at 1:51pm

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

Thanks

Andy

#103194

You must be logged in to reply to this topic.