查看: 1021|回复: 0

关于运行实例不成功的疑惑-create and driving a character system

[复制链接]

该用户从未签到

发表于 2014-9-29 17:51:43 | 显示全部楼层 |阅读模式
大家好,
我正在通过<OpenSceneGraph 3.0 Beginner's Guide> 学习OSG。
在文章中的Chapter 8 : Animating Scene Objects 中的示例“Time for action - creating and driving a character system”结果不成功,特来请教。
参照说明运行程序后,bignathan.osg 正确地显示在屏幕上, 但控制台输出的内容异常,并不是文章中的列举 bignathan.osg 中的动作名称列表,大家有遇到类似的情况吗?
OSG version : 3.0.1
运行环境: vMware 10  + Windows XP
控制台输出信息:
LinkVisitor links 15 for "Foot.L"
LinkVisitor links 15 for "Footroll.L"
LinkVisitor links 15 for "Foot_IK.L"
LinkVisitor links 15 for "KneeTarget.L"
LinkVisitor links 15 for "Foot.R"
LinkVisitor links 15 for "Footroll.R"
LinkVisitor links 15 for "Foot_IK.R"
LinkVisitor links 15 for "KneeTarget.R"
LinkVisitor links 15 for "Pelvis"
LinkVisitor links 15 for "Spine"
LinkVisitor links 15 for "Chest"
LinkVisitor links 15 for "Humerus.L"
LinkVisitor links 15 for "Forearm.L"
LinkVisitor links 15 for "Hand.L"
LinkVisitor links 15 for "Humerus.R"
LinkVisitor links 15 for "Forearm.R"
LinkVisitor links 15 for "Hand.R"
LinkVisitor links 16 for "Head"
Channel scale does not contain a valid symbolic name for this class UpdateMaterial
Channel quaternion does not contain a valid symbolic name for this class UpdateMaterial
Channel translate does not contain a valid symbolic name for this class UpdateMaterial
Channel scale does not contain a valid symbolic name for this class UpdateMaterial
Channel quaternion does not contain a valid symbolic name for this class UpdateMaterial
Channel translate does not contain a valid symbolic name for this class UpdateMaterial
Channel scale does not contain a valid symbolic name for this class UpdateMaterial
Channel quaternion does not contain a valid symbolic name for this class UpdateMaterial
Channel translate does not contain a valid symbolic name for this class UpdateMaterial
Channel scale does not contain a valid symbolic name for this class UpdateMaterial
Channel quaternion does not contain a valid symbolic name for this class UpdateMaterial
Channel translate does not contain a valid symbolic name for this class UpdateMaterial
Channel scale does not contain a valid symbolic name for this class UpdateMaterial
Channel quaternion does not contain a valid symbolic name for this class UpdateMaterial
Channel translate does not contain a valid symbolic name for this class UpdateMaterial
LinkVisitor links 16 for "Head"
LinkVisitor links 15 for "Thigh.L"
LinkVisitor links 15 for "Shin.L"
LinkVisitor links 15 for "Thigh.R"
LinkVisitor links 15 for "Shin.R"
uniq groups 16 for Body
RigTransformSoftware Bone Group not found, skip the influence group Group

这里再罗嗦地把测试程序代码贴出来:
#include <osgAnimation/BasicAnimationManager>
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
#include <osg/ArgumentParser>
#include <iostream>



int _tmain (int argc, char* argv[])
{
        osg::ArgumentParser arguments( &argc, argv );

        bool listAll = false;
        std::string animationName;
        arguments.read("--animation", animationName);

        if (arguments.read("--listall")) listAll = true;

        osg::ref_ptr<osg::Node> model = osgDB::readNodeFile("bignathan.osg");
        if (!model) return 1;

        osgAnimation::BasicAnimationManager* manager =
                dynamic_cast<osgAnimation::BasicAnimationManager*>
                (model->getUpdateCallback());
        if (!manager) return 1;

        const osgAnimation::AnimationList& animations =
                manager->getAnimationList();
        if (listAll) std::cout << "**** Animations ****" << std::endl;
        for (unsigned int i=0; i<animations.size(); ++i)
        {
                const std::string& name = animations[i]->getName();
                if (name == animationName)
                        manager->playAnimation(animations[i].get());
                if (listAll) std::cout << name << std::endl;
        }

        if (listAll)
        {
                std::cout<< "************************" << std::endl;
                return 0;
        }

        osgViewer::Viewer viewer;
        viewer.setSceneData(model.get());
        return viewer.run();

}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表