Home
Reply
Contributor
Posts: 24
0

HOOPS animation issue

I followed HOOPS/MVO programming guide to construct animation, but seems animation doesn't work

Anyone can provide code demo to construct and play a simple animation?

Thanks very much

Contributor
Posts: 24
0

Re: HOOPS animation issue

 

Following is the demo code, but animation doesn't work

 


HC_Open_Segment_By_Key(m_pHView->GetModelKey());
HC_Open_Segment("car");
HC_Insert_Sphere((void*)(&HPoint(0,0,0)), 200, NULL, NULL);
HC_Close_Segment();
HC_Close_Segment();

 

HBhvBehaviorManager *bm = m_pHView->GetModel()->GetBhvBehaviorManager();
if( !bm )
{}
HPoint *pivot = new HPoint(0,0,0);
HBhvAnimation *driverCar = bm->AddAnimation("driverCar", "SPATH:MODEL/car", pivot);

HPoint posA(0,0,0), posB(1000,100,10),posC(200,2000,20);

bm->AddPositionKeyframe("driverCar", 0, posA, true);
bm->AddPositionKeyframe("driverCar", 10, posB, true);
bm->AddPositionKeyframe("driverCar", 20, posC, true);


bm->Play();
m_pHView->Update();