FranklinRoosevelt Posted June 9, 2015 Posted June 9, 2015 Hello everyone, I need found head angle (bone), rot Y: Function getPedBoneRotation do not have. And I make this: PosXr, PosYr, PosZr = getPedBonePosition (localPlayer, 6) PosXl, PosYl, PosZl = getPedBonePosition (localPlayer, 7) vectorX, vectorY, vectorZ = PosXl - PosXr, PosYl - PosYr, PosZl - PosZr longVector = math.sqrt( (vectorX*vectorX) + (vectorY*vectorY) + (vectorZ*vectorZ) ) longProjections = math.sqrt( (vectorX*vectorX) + (vectorY*vectorY) ) roll = math.deg( math.acos( ( ( vectorX * vectorX + vectorY * vectorY ) / ( longVector * longProjections ) ) ) ) And need make this: rightRoll = math.pi - roll, when deployed angle. Code not important, look for algorithm. But it's bad works with anim. Maybe exist better method? I hope you understand me.
FranklinRoosevelt Posted June 10, 2015 Author Posted June 10, 2015 What are you trying to do? Attach camera to head with this rotation what I want found.
Addlibs Posted June 10, 2015 Posted June 10, 2015 The head has 2 bones. You can play around and make a calculation to find one's rotational offset (preferably the higher bone)
FranklinRoosevelt Posted June 10, 2015 Author Posted June 10, 2015 The head has 2 bones. You can play around and make a calculation to find one's rotational offset (preferably the higher bone) Are you looked in my code?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now