<div dir="ltr"><div><div><div><br>I've tried the OSG 3.2 branch and this version exhibited the same problem.<br><br></div>Then I had a closer look at the BVH files supplied by that web site. I am finding that it defines<br></div>rotational parameters always in the order Z, Y, X. That is different from the sequence I expect<br></div>from various online sources that use Z, X, Y.<br><div><div><br>in the plugin code, hence I adjust the sequence of keyValues read from the file to read z, y, x<br>in this order.<br><br> if ( ch&0x08 ) fr.readSequence( keyValue[2] ); // Z<br> if ( ch&0x20 ) fr.readSequence( keyValue[1] ); // Y<br> if ( ch&0x10 ) fr.readSequence( keyValue[0] ); // X<br><br></div><div>But this alone wasn't sufficient to get correct results.<br><br></div><div>I also had to swap the order in which we generate the rotation matrix to X*Y*Z.<br></div><div><br> osg::Matrix rotMat = <br> osg::Matrix::rotate(osg::DegreesToRadians(keyValue[0]), osg::Vec3(1.0,0.0,0.0))<br> * osg::Matrix::rotate(osg::DegreesToRadians(keyValue[1]), osg::Vec3(0.0,1.0,0.0))<br> * osg::Matrix::rotate(osg::DegreesToRadians(keyValue[2]), osg::Vec3(0.0,0.0,1.0));<br><br></div><div>This appears to be the opposite order in which the above Euler angles are specified.<br></div><div><br>Now the animations play out correctly, as far as I can tell.<br><br></div><div>I will have to do some more online research to understand whether the BVH spec actually allows<br></div><div>to specify rotation in an arbitrary order and what the definitive answer about the sequence of applying<br>the Euler angles is.<br><br></div><div>The first change could certainly determined automatically from the input file, but whether or not the<br>sequence of matrix multiplications shall always occur in the opposite order is up for debate.<br><br></div><div>I might propose a suitable patch to the BVH plug-in later.<br><br></div><div>Christian<br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-01 14:38 GMT+02:00 Christian Buchner <span dir="ltr"><<a href="mailto:christian.buchner@gmail.com" target="_blank">christian.buchner@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br></div>This is how I call the osganimationviewer to display a skeleton from the motion data.<br><br>osganimationviewer --drawbone C:\mocap\motionbuilder\01\01_02.bvh -O solids<br><br></div>Just the result is a bit unexpected...<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-04-01 14:33 GMT+02:00 Christian Buchner <span dir="ltr"><<a href="mailto:christian.buchner@gmail.com" target="_blank">christian.buchner@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi all,<br><br></div>I've been trying to get the BVH files from this site to import into the current OSG 3.4 branch<br><a href="https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion" target="_blank">https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion</a><br><br></div>These are conversions of the original motion capture data that CMU provides for free in a different format, optimized for the three applications MotionBuilder, DAZ Studio and 3DS MAX.<br><br></div>I've tried replaying the animations in osganimationviewer using the --drawbone flag. Usually one needs to zoom out the camera to get the full skeleton into view. The issue that I am having is that I see weird and unexpected rotations of the entire skeleton, as well as specific joints - regardless of the version of the BVH files I download.<br></div></div><br></div><div>Has the OpenSceneGraph BVH plug-in ever worked on these mocap files? Could it be that a code regression has recently broken the plug-in?<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div>Christian<br><br></div></font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>