www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: ani.tumanyan on March 05, 2013, 05:38:42 pm

Title: Pick a specific part of Ninja
Post by: ani.tumanyan 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
Title: Re: Pick a specific part of Ninja
Post by: EgonOlsen 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!?
Title: Re: Pick a specific part of Ninja
Post by: ani.tumanyan 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 :)!
Title: Re: Pick a specific part of Ninja
Post by: ani.tumanyan 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!
Title: Re: Pick a specific part of Ninja
Post by: EgonOlsen 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.