ogre demo_skeletalanimation

D:\stu\GAMEENGINE\ogre\Tools\XMLConverter

OgreXMLConverter.exe

from:http://www.ogre3d.org/docs/manual/manual_47.html

The OgreXmlConverter tool can converter binary .mesh and .skeleton files to XML and back again - this is a very useful tool for debugging the contents of meshes, or for exchanging mesh data easily - many of the modeller mesh exporters export to XML because it is simpler to do, and OgreXmlConverter can then produce a binary from it. Other than simplicity, the other advantage is that OgreXmlConverter can generate additional information for the mesh, like bounding regions and level-of-detail reduction.

Syntax: Usage: OgreXMLConverter sourcefile [destfile]sourcefile = name of file to convertdestfile = optional name of file to write to. If you don't specify this OGRE works it out through the extension and the XML contents if the source is XML. For example test.mesh becomes test.xml, test.xml becomes test.mesh if the XML document root is <mesh> etc. When converting XML to .mesh, you will be prompted to (re)generate level-of-detail(LOD) information for the mesh - you can choose to skip this part if you wish, but doing it will allow you to make your mesh reduce in detail automatically when it is loaded into the engine. The engine uses a complex algorithm to determine the best parts of the mesh to educe in detail depending on many factors such as the curvature of the surface, the edges of the mesh and seams at the edges of textures and smoothing groups - taking advantage of it is advised to make your meshes more scalable in real scenes.

I use OgreXMLConverter.exe to generate rjaiqua.mesh.xml, jaiqua.skeleton.xml

jaiqua.skeleton.xml:

<skeleton> <bones>--------------------- <bone id=" 0" name=" head"><position x=" 0.5" y=" 0" z=" -4.44089e-016" /> <rotation angle=" 0.309934"><axis x=" 0.283808" y=" 0.564704" z=" 0.77496" /></rotation></bone> <bone id=" 1" name=" neck"><position x=" 0" y=" -3.55271e-015" z=" 0" /> <rotation angle=" 1.25688"><axis x=" 0.0431474" y=" -0.0144685" z=" 0.998964" />

</rotation>

......................

bonehierarchy>

<boneparent bone=" head" parent=" neck" /><boneparent bone=" neck" parent=" neckroot" />

<boneparent bone="Rbicept" parent="Rarmroot ......

<animations>

<animation name="Run" length="0.7"> <tracks> <track bone="head"> <keyframes> <keyframe time="0"> <translate x="0" y="0" z="2.22045e-016" /> <rotate angle="0.274176"> <axis x="-0.499034" y="-0.502816" z="-0.705791" /> </rotate> </keyframe> <keyframe time="0.166667"> <translate x="0" y="0" z="0" /> <rotate angle="0.312969"> <axis x="-0.279987" y="-0.55982" z="-0.779878" /> </rotate> </keyframe>

<animation name="Sneak" length="10.6333">。。。

ogre demo_skeletalanimation - wwweurope - wwweurope的博客
ogre demo_skeletalanimation - wwweurope - wwweurope的博客

ijust for fun(modify code slightly):

n skeletalanimation.h

line 170:

   if(0==i)
            mAnimState[i] = ent->getAnimationState("Turn");
    if(1==i)
     mAnimState[i] = ent->getAnimationState("Run");
    if(2==i)
     mAnimState[i] = ent->getAnimationState("Stagger");
    if(3==i)
     mAnimState[i] = ent->getAnimationState("Sneak");
    if(4==i)
     mAnimState[i] = ent->getAnimationState("Walk");

//蒙皮技术。。。

转载于:https://www.cnblogs.com/europelee/archive/2010/07/11/3388665.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值