|
发表于 2011-1-6 18:30:33
|
显示全部楼层
结合很简单,您把N个点插值先成一条path,又生成一条道路呗,这两者并不影响,道路只是几何体而已,压入生成路径的类似代码如下:
- for(int i=0;i<numSamples;++i)
- {
- osg::Vec3 position(center+osg::Vec3(sinf(yaw)*radius,cosf(yaw)*radius,0.0f));
- osg::Quat rotation(osg::Quat(roll,osg::Vec3(0.0,1.0,0.0))*osg::Quat(-(yaw+osg::inDegrees(90.0f)),osg::Vec3(0.0,0.0,1.0)));
-
- animationPath->insert(time,osg::AnimationPath::ControlPoint(position,rotation));
- yaw += yaw_delta;
- time += time_delta;
- }
复制代码 |
|