Author Topic: Pick a specific part of Ninja  (Read 2277 times)

Offline ani.tumanyan

  • byte
  • *
  • Posts: 10
    • View Profile
Pick a specific part of Ninja
« on: March 05, 2013, 05:38:42 pm »
Hi everybody,

I'm trying to rotate specific parts of Ninja object. So I need to determine the specific bone the user has picked by touching on some part of the screen. Using collision detection technique I can understand which object was picked, but that's not enough as this returns only the whole object (the Ninja).

So my question here is,  how to know which bone was selected by a touch event?


Thanks in advance!
Ani

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Pick a specific part of Ninja
« Reply #1 on: March 05, 2013, 08:00:36 pm »
It might be possible to detect which bone is closest to the collision polygon/point. But i'm not sure...maybe you should ask this question in the Bones section!?

Offline ani.tumanyan

  • byte
  • *
  • Posts: 10
    • View Profile
Re: Pick a specific part of Ninja
« Reply #2 on: March 05, 2013, 08:15:05 pm »
Thanks Egon! I've posted this question in Bones section as well. Could not find a way to move instead of creating another one. Anyway, thanks for your quick reply :)!

Offline ani.tumanyan

  • byte
  • *
  • Posts: 10
    • View Profile
Re: Pick a specific part of Ninja
« Reply #3 on: March 05, 2013, 09:33:23 pm »
Hey Egon! I have a quick question here. As you mentioned it might be possible to get the closest bone to the collision point. I can get the collision position relative to the world space. Is that possible to find that position relative to the object (Ninja)? Because I can get joint's location relative to the object or relative to it's parent.


Thanks!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Pick a specific part of Ninja
« Reply #4 on: March 06, 2013, 09:12:25 am »
You could try to use the PolygonManager or an IVertexController to calculate some relation between the collision point and the mesh, but it might be a bit fiddly.