Пример #1
0
static void printGeom (PrintingContext &c, dxGeom *g)
{
    unsigned long category = dGeomGetCategoryBits (g);
    if (category != (unsigned long)(~0)) {
        c.printIndent();
        fprintf (c.file,"category_bits = %lu\n",category);
    }
    unsigned long collide = dGeomGetCollideBits (g);
    if (collide != (unsigned long)(~0)) {
        c.printIndent();
        fprintf (c.file,"collide_bits = %lu\n",collide);
    }
    if (!dGeomIsEnabled (g)) {
        c.print ("disabled",1);
    }
    switch (g->type) {
        case dSphereClass: printSphere (c,g); break;
        case dBoxClass: printBox (c,g); break;
        case dCapsuleClass: printCapsule (c,g); break;
        case dCylinderClass: printCylinder (c,g); break;
        case dPlaneClass: printPlane (c,g); break;
        case dRayClass: printRay (c,g); break;
        case dConvexClass: printConvex (c,g); break;
        case dTriMeshClass: printTriMesh (c,g); break;
        case dHeightfieldClass: printHeightfieldClass (c,g); break;
    }
}
Пример #2
0
int main( int argc, char** argv ) {
  // Seed the random number generator
  // with the time measured in seconds.
  // "time_t" is a just another name for
  // a long (64 bit) integer.
  time_t t = time(NULL) ;
  srand( t ) ;

  double radius = 0.1;
  Vector spheres[51];
  printPOVPrefix();
  int i; 

  for( i = 0; i < 50; i++ ) {
    double x = randomDouble();
    double y = randomDouble();
    double z = randomDouble();
    Vector center = makeVector( x, y, z );

    spheres[i] = center;	
    
  } // Create spheres located randomly at centers of components with values between 0 & 1
  int j, k;

 for(j = 0; j < 50; j++){
       for(k = 0; k< 50; k++) {
	 if( magnitude ( diff(spheres[j],spheres[k])) > 0.2){
	    printSphere(spheres[j], radius, spheres[j] );
	  }
       }
  }// print non intersecting spheres with colors derived from their center values



	
} // main( int, char** )