Show
Ignore:
Timestamp:
03/23/09 17:07:43 (6 years ago)
Author:
robert
Message:

From Roland Smeenk, "Here's a small simplification of the osganimationmorph example. Only one morphtarget needs to be added to the MorphGeometry? since it already has a base geometry. The animation will morph between the base geometry and the first target.

"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osganimationmorph/osganimationmorph.cpp

    r9928 r9951  
    6363    osgViewer::Viewer viewer(arguments); 
    6464 
    65  
    6665    osgAnimation::Animation* animation = new osgAnimation::Animation; 
    6766    osgAnimation::FloatLinearChannel* channel0 = new osgAnimation::FloatLinearChannel; 
     
    7170    channel0->setName("0"); 
    7271 
    73     osgAnimation::FloatLinearChannel* channel1 = new osgAnimation::FloatLinearChannel; 
    74     channel1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::FloatKeyframe(0,1.0)); 
    75     channel1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::FloatKeyframe(1,0.0)); 
    76     channel1->setTargetName("MorphNodeCallback"); 
    77     channel1->setName("1"); 
    78  
    7972    animation->addChannel(channel0); 
    80     animation->addChannel(channel1); 
    8173    animation->setName("Morph"); 
    8274    animation->computeDuration(); 
     
    9991    // initialize with the first shape 
    10092    osgAnimation::MorphGeometry* morph = new osgAnimation::MorphGeometry(*geom0); 
    101     morph->addMorphTarget(geom0); 
    10293    morph->addMorphTarget(geom1); 
    10394