Re: [osg-users] Character animation in OSG

5 views
Skip to first unread message

Michele Olsen

unread,
Jul 12, 2010, 11:30:09 AM7/12/10
to osg-...@lists.openscenegraph.org
Hello,

I've been working in osgCal and cal3d for a few weeks now and one thing I would like to see in osgAnimation is the capability to control a bone during a cycle animation. Specifically, I want to be able to control where a head is looking while an idle animation is playing. I don't think there is a simple way to do it in osgCal or cal3d, or I haven't found it yet. Also, documentation could be improved upon.

Thanks for all your hard work!

Michele

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29926#29926

_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Cedric Pinson

unread,
Jul 12, 2010, 12:20:06 PM7/12/10
to osg-...@lists.openscenegraph.org
Hi Michele,
In osgAnimation a Bone inherit from MatrixTransform so a way to do it
run a visitor that will check the matrix of your Bone. Another way could
be to add a Custom callback to your bone that will do something on your
Bone. I have not tried yet but I guess both way should work.

Cheers,
Cedric

--
Provide OpenGL, WebGL and OpenSceneGraph services
+33 659 598 614 Cedric Pinson mailto:cedric...@plopbyte.net
http://www.plopbyte.net

signature.asc

Jan Ciger

unread,
Jul 12, 2010, 5:38:12 PM7/12/10
to osg-...@lists.openscenegraph.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/12/2010 05:30 PM, Michele Olsen wrote:
> Hello,
>
> I've been working in osgCal and cal3d for a few weeks now and one
> thing I would like to see in osgAnimation is the capability to
> control a bone during a cycle animation. Specifically, I want to be
> able to control where a head is looking while an idle animation is
> playing. I don't think there is a simple way to do it in osgCal or
> cal3d, or I haven't found it yet. Also, documentation could be
> improved upon.
>
> Thanks for all your hard work!
>
> Michele
>

Hello,

You can do this, however, this is deep in the Cal3D data structures.
osgCal is only a thin rendering wrapper.

This is going to be from hazy memory from about 6 years ago when I did
this, so do not take me for my word here.

What you have to do is to get a pointer to the Cal3D Model instance (I
think it was that - I believe osgCal allows you to get the pointer),
from that you can get to the individual bones. However, if you try to
drive the bones manually, you need to disable the default animation
mixer or your data will be overriden. The way to do that is to manually
call the individual functions to update the skeleton, to update the
skin, etc, but do not update the animation mixer. You will need to make
you own mixing if you want to e.g. move the head on top of another
animation. Overall, it is doable, but it is quite a mess - Cal3D is not
designed with procedural animation in mind.

Regards,

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org/

iD8DBQFMO4tBn11XseNj94gRAqXWAKCzaOEffH3eiXe33O2sgrKkLo8UnACdHDaJ
WEk9pnM1lJpoXJxtJuk0X0s=
=KZbm
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages