Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

/home/xchen/xia/src/glrender/demoTorus.cc

#include <View.H>
#include <TensorBlossom.H>

using namespace xchen;

void bsp_torus(View* v)
//int main()
{
  TensorBlossom<1,4> *circle = new TensorBlossom<1,4>(2,8);
 
  double w = sqrt(2.0) / 2;
  E4 p(1, 0, 0, 1);
  circle->ControlMesh() = 
    tX(2.0)*p, 
    (tX(2.0*w)*(rZ(45)*p)).Szw(w), 
    tX(2.0)*(rZ(90)*p), 
    (tX(2.0*w)*(rZ(135)*p)).Szw(w),
    tX(2.0)*(rZ(180)*p), 
    (tX(2.0*w)*(rZ(225)*p)).Szw(w),
    tX(2.0)*(rZ(270)*p), 
    (tX(2.0*w)*(rZ(315)*p)).Szw(w);
    
  circle->IsRational() = true;
  circle->SetPeriodicEnd();
  circle->KnotVector() = 0.,0, 1, 1, 2, 2, 3, 3, 4;
    
  cout << "\n________________________________________________________________________________________________________________________";
  cout << "\nCircle is \n" << *circle << endl;
    
//   TensorBlossom<2,4> *torus = new TensorBlossom<2,4>(revolution, circle);
//   cout << "\nTorus is \n" << *torus << endl;

//   torus->Subdivide(2);
  //  torus->Convert2OpenEnd();
  new glModel(v, circle); //torus
}


void new_glModel(View* v) 
{
   bsp_torus(v);
}

Generated on Wed Apr 7 21:40:48 2004 by doxygen1.2.18