University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Using bvh for sk skektons | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Using bvh for sk skektons
July 29, 2016
6:50 am
Avatar
Member
Members
Forum Posts: 16
Member Since:
January 18, 2016
sp_UserOfflineSmall Offline

Hello

I've implemented retargeting as written in doc, but no any rotation occurs when a bvh motion is applied to ChrBrad.sk. In debugger I see the joints are mapped, but channels are not, because motion (and bvh skeleton) channels types are X(Y, Z)Rot , but destination channels (with standard SB name) expect Quat type.

Should I convert Euler angles into quaternion for bvh motion/skeleton? Or there is a better solution(s)?

Thx

July 29, 2016
10:40 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Not sure what you mean; bvh specifies Euler angles which is in turn converted into quaternions during runtime.

Can you look at the channels of the motion and make sure this is the case (Window->Data Viewer->Motion drop down, look at channel names and types)

 

Ari

July 31, 2016
1:14 am
Avatar
Member
Members
Forum Posts: 16
Member Since:
January 18, 2016
sp_UserOfflineSmall Offline

Ari Shapiro said

Can you look at the channels of the motion and make sure this is the case (Window->Data Viewer->Motion drop down, look at channel names and types)   

Yes, they are correct "Quat" there. My fault, I loaded .bvh motion wrong (must use ParserBVH). Clear now, thx.

But I've got another problem with .bvh retargeting. The file data:

HIERARCHY
ROOT Hips
{
    OFFSET 0.00 0.00 0.00

// skeleton

MOTION
Frames: 122
Frame Time: 0.0333333
1.5203 88.1176 0.5801

The retargeting works but ChrBrad "flies" up (along Y). I understand it's not an error formally - motion data offset is far away of skeleton offset. Setting OFFSET to first frame works unsafe, a small "Y-shift" is still here. Also it's unwanted to recommend to users to edit bvh files manually. How to place motion on ground "auto" ?

Thx

July 31, 2016
11:44 pm
Avatar
Member
Members
Forum Posts: 16
Member Since:
January 18, 2016
sp_UserOfflineSmall Offline

After loading bvh (when I've skeleton and motion) I've used following code to "touch down" motion

SrBox boundingBox = skeleton->getBoundingBox();
SkJoint* baseJoint = skeleton->root();
SrVec basePos = baseJoint->gmat().get_translation();
SrVec offset = boundingBox.center();
offset.y = basePos.y - boundingBox.a.y;
        
baseJoint->offset(offset);
std::string baseName = baseJoint->jointName();
motion->translate(-offset.x, -offset.y, -offset.z, baseName);

Let me know if there is a better solution

Thx

August 4, 2016
10:08 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

There might be a case where the root joint isn't the bottom-most joint (for example, the root joint could be in the middle of the skeleton, and the foot could be the bottom). In that case, you want to offset by the bottom-most joint, not the root joint.

 

Ari

Forum Timezone: America/Los_Angeles

Top Posters:

jwwalker: 80

jyambao: 52

rbaral: 47

adiaz: 30

WargnierP: 29

lucky7456969: 28

mbarros: 28

avida.matt: 26

JonathanW: 24

laguerre: 23

Member Stats:

Guest Posters: 69

Members: 122211

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 531

Posts: 2495