www.pudn.com > nurbs++3_0_10.zip > tnurbsS.C


#include 
#include 
#include 

int main(){
  Matrix_Point3Df Pts(4,5) ;
  int i,j ;

  using namespace PLib ; 


  for(i=0;i sub(surf) ;
  sub.drawSubdivisionVRML("tnurbsSb.wrl",0.5);

  surf.writeVRML("tnurbsS2.wrl",Color(255,255,0),float(0.1)) ;


  NurbsCurvef curve ;
  curve.makeCircle(Point3Df(0.5,0.5,0),0.3);


  Vector_Point3Df pnt(100) ;

  for(i=0;i<100;++i){
    Point3Df param = curve.pointAt(float(i)/99.0) ;
    pnt[i] = surf.pointAt(param.x(),param.y());
  }

  NurbsCurvef curve2 ;

  curve2.globalInterp(pnt,3) ; 

  ofstream fout ;

  fout.open("tnurbsST.wrl");
  surf.writeVRML(fout,Color(255,255,255)) ;

  curve2.writeVRML(fout,0.1,30,Color(255,0,0),6,60) ;

  curve.writeVRML(fout,0.1,30,Color(0,255,0),6,60) ;

  curve.degreeElevate(7) ;

  for(i=0;i