Bone coordinate rotation and import problems

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Tobias314
Posts: 10
Joined: Thu Oct 20, 2011 6:27 pm

Bone coordinate rotation and import problems

Post by Tobias314 »

1) My main issue is when I import a model with bones (both using the .b3d and .x blender exporters) and I get some odd initial rotations at rest pose (example from the b3d with XYZ rotations)

Code: Select all

Joints: 23
player: 0 -0 0
root: 270 -0 0
hips: 90 360 180
torso: 356.634 360 5.46145e-06
shoulder.l: 279.225 79.5812 18.6575
bicep.l: 292.398 354.663 356.036
forearm.l: 353.368 330.227 25.5132
hand.l: 358.842 19.1115 344.733
chest: 356.241 6.40334e-05 1.57477e-06
neck: 143.13 360 180
head: 131.186 48.757 139.326
shoulder.r: 279.225 280.419 341.343
bicep.r: 292.398 5.3375 3.96392
forearm.r: 353.368 29.7729 334.487
hand.r: 358.842 340.888 15.2673
thigh.l: 184.41 18.4349 4.99999
shin.l: 2.81367 344.463 1.22871
foot.l: 228.837 317.186 179.902
toe.l: 47.4051 0.6858 359.37
thigh.r: 184.41 341.565 355
shin.r: 2.81368 15.5371 358.771
foot.r: 228.837 42.8136 180.098
toe.r: 47.4051 359.314 0.630479
 
How do I set these bones such that the rest pose has their rotation at zero?

2) How would I rotate bones using global coordinates?
I can't seem to entirely understand how irrlicht is interpreting euler rotations on bones, and while I'm able to reproduce many rotations using transforms from blender; I get some seemingly nonsensical rotations about certain axis.

I'm tearing my hair out! HELP!
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Bone coordinate rotation and import problems

Post by mongoose7 »

Try exporting the models with no rotations in the rest pose.
Tobias314
Posts: 10
Joined: Thu Oct 20, 2011 6:27 pm

Re: Bone coordinate rotation and import problems

Post by Tobias314 »

That is with no rotations. Blender shows no rotations on any bones when I export. But that's an issue I can deal with to a degree.

Anyone know how I can rotate bones around global Euler axes?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Bone coordinate rotation and import problems

Post by mongoose7 »

This would be an unusual application. Why are you using bones when it would appear that the bones are not bones?

If you want to persist, I should think you have to trace the bone path to get the combined transformation of the parent bone, invert it and combine with the absolute bone transformation to form the relative bone transformation to apply to the bone.
Tobias314
Posts: 10
Joined: Thu Oct 20, 2011 6:27 pm

Re: Bone coordinate rotation and import problems

Post by Tobias314 »

mongoose7 wrote:This would be an unusual application. Why are you using bones when it would appear that the bones are not bones?
!?
I'm using Blender. I assume the issue is with the exporters (or my use of them) or irrlicht's importers. Because both the .X and the .b3d export give me similar garbage at rest pose, it seems more likely to be irrlicht.
mongoose7 wrote:If you want to persist, I should think you have to trace the bone path to get the combined transformation of the parent bone, invert it and combine with the absolute bone transformation to form the relative bone transformation to apply to the bone.
I may give that a try. I previously attempted converting my rotation vector to a matrix4 and multiplying it by the absolute transformation of the bone, but that made for improper rotations, and produced some odd rather glitchy results when animating.

I understand that bones exists in a hierarchical chain of transformation inheritance, but wouldn't getAbsoluteTranformation() get the data I need? How does getAbsoluteTranformation() behave differently on bones?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Bone coordinate rotation and import problems

Post by mongoose7 »

I guess. I was just talking conceptually. But I think you need to do more debugging.
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: Bone coordinate rotation and import problems

Post by vivekSivamRP »

I too had the same issues initially.
2) How would I rotate bones using global coordinates?
'JCoopers' explanation in the below link will answer your question clearly.
http://stackoverflow.com/questions/1380 ... l-and-back

For your first question:
1) My main issue is when I import a model with bones (both using the .b3d and .x blender exporters) and I get some odd initial rotations at rest pose
While exporting the model from blender you should notice the 'ROLL' value of bones in 'EDIT' mode. That 'ROLL' value might be the reason for rotation values initially.So your study about 'ROLL' value may clear your doubts.
Post Reply