|
大家好,
我正在通过<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();
}
|
|