Hi, i am trying to rotate a bone but its not working like i imagined. So after long time without any clue. i came for help hahaha…
i have a cylinder and i use lookAt() to make the cylinder look at that direction, then i get its Quaternion rotation and then i set it in the bone… but its not working properly…
ex.: imagine a lookAt to point (-20,20,20). So the cylinder is looking UP and LEFT. but the bone is DOWN and RIGHT. i realized that bones’ initial point became cylinder’s end point and bones’ end point became cylinder’s initial point…
i tried inverse, negate, anything…
i am using Ninja mesh from jme3 tutorial.
i think its not working because cylinder initial position its lying down and bone is standing. but i am not sure… Any idea to fix it?
put the cylinder rotated into a node, then rotate your node and use that rotation for the bone.
put the cylinder rotated into a node, then rotate your node and use that rotation for the bone.
It didn't worked.
what I am trying to do is for example: rotate the cylinder to pointing up then get its rotation and set ninja’s arm the same rotation…
but It’s not working… instead when i do it, the ninja’s arm is pointing downwards…
any ideia?
hm is the bones parent absolute? I wouldn’t wonder if they are moved in relation to each other, so you probably need a relative rotation to the parentbone.
what is parent absolute?
my code is here…
http://pastebin.com/hS7qfxSJ
what i mean if you calcualte your rotation in relation to the geomtry,it might be wrong, it could be (only pseculating here) that a bone’s rotation is in relation to it’s parent (bone). wich would mean you must somehow convert your world space rotation down to a bone space rotation.