Jump to content

Touch sphere with Image


haired
 Share

Recommended Posts

Hello guys,

I'm doing an app to control objects via a Kinect sensor. I finally managed to control two hands (they are just images) on the screen, and the next step is to be able to put a Hand in front of a sphere and allow this sphere to follow the position of the hand.

 

My hand is just an Image on the screen I move it by changing his left and top css properties, and my problem is how to know when my hand "touched" the sphere.

 

I've tried with BABYLON.Ray(hand.x,hand.y) but it's like the ray is pointing somewhere I don't know, and the "touch" occurs somewhere far from the sphere.

 

Any ideas ? Thank you in advance. :)

post-9561-0-20220200-1404953217_thumb.pn

Link to comment
Share on other sites

  • 2 weeks later...

Thank you Kostar, it does exactly the trick ;)

I found that Ray nor Pick technics didn't worked because my hands images were into a div and the renderCanvas into an another one, so the pick never worked. I don't really understand why, by it works now :) .

Thank you again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...