示例#1
0
int main(int argc,char** argv)
{
	auxInitDisplayMode(AUX_SINGLE|AUX_RGB);
	auxInitPosition(0,0,400,400);
	auxInitWindow("Composite Modeling Transformations");

	Init();

	auxKeyFunc(AUX_LEFT,shoulderSubtract);
	auxKeyFunc(AUX_RIGHT,shoulderAdd);
	auxKeyFunc(AUX_UP,elbowAdd);
	auxKeyFunc(AUX_DOWN,elbowSubtract);
	auxReshapeFunc(Resize);
	auxMainLoop(Paint);
	return(0);
}
示例#2
0
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////MAIN ///////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
int APIENTRY WinMain(HINSTANCE hInst,HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
{
float pos[4] = {1,1,10,1};
float dir[3] = {-1,-1,-1};
float lposSt[4] = {0,0,0,1};
float dir2[3] = {1,1,1};
int val = 180;

    GLfloat mat_specular[] = {3,3,3,10};

    auxInitPosition( 250, 110, WIDTH, HEIGHT);
    auxInitDisplayMode( AUX_RGB | AUX_DEPTH24 | AUX_DOUBLE);    
	auxInitWindow("OpenGL Laba Project!");
    auxIdleFunc(oGl_Render);
    auxReshapeFunc(resize);	
    
	glEnable(GL_DEPTH_TEST);	
    glEnable(GL_COLOR_MATERIAL);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
	glEnable(GL_LIGHT1);
	glEnable(GL_ALPHA);
	glEnable(GL_BLEND);
	glShadeModel(GL_FLAT);
	
    glLightfv(GL_LIGHT0, GL_POSITION, pos);
	glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, dir);	

	glLightfv(GL_LIGHT1, GL_POSITION, lposSt);
	glLightfv(GL_LIGHT1, GL_SPOT_DIRECTION, dir2);
	glLightiv(GL_LIGHT1, GL_SPOT_CUTOFF, &val);



    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialf(GL_FRONT, GL_SHININESS, 128.0);    
	
	auxKeyFunc(AUX_LEFT, Proc_Left);
	auxKeyFunc(AUX_RIGHT, Proc_Right);
	auxKeyFunc(AUX_UP, Proc_Up);
	auxKeyFunc(AUX_DOWN, Proc_Down);	
	auxKeyFunc(AUX_ESCAPE, Proc_Quit);	
	auxMouseFunc(AUX_LEFTBUTTON, AUX_MOUSELOC, Mouse_Proc);	

    auxMainLoop(oGl_Render);
	return 0;
}
示例#3
0
void main(int argc,char** argv)
{
	if(Args(argc,argv)==GL_FALSE)
		auxQuit();

	windW=600;
	windH=300;
	auxInitPosition(0,0,windW,windH);

	windType=AUX_DEPTH16;
	windType|=(rgb)?AUX_RGB:AUX_INDEX;
	windType|=(doubleBuffer)?AUX_DOUBLE:AUX_SINGLE;

	auxInitDisplayMode(windType);

	if(auxInitWindow("速度测试")==GL_FALSE)
		auxQuit();

	auxExposeFunc((AUXEXPOSEPROC)Resize);
	auxReshapeFunc((AUXRESHAPEPROC)Resize);
	auxKeyFunc(AUX_a,Key_a);
	auxKeyFunc(AUX_d,Key_d);
	auxKeyFunc(AUX_f,Key_f);
	auxKeyFunc(AUX_F,Key_F);
	auxKeyFunc(AUX_s,Key_s);
	auxKeyFunc(AUX_t,Key_t);
	auxMainLoop(Paint);
}
示例#4
0
void main()
{
	float pos[4] = { 3, 3, 3, 1 };
	float dir[3] = { -1, -1, -1 };
	GLfloat mat_specular[] = { 1, 1, 1, 1 };

	srand(time(0));

	for (int i = 0; i < 50; i++)
	{
		initialize(x[i], y[i]);
	}

	auxInitPosition(50, 10, 400, 400);
	auxInitDisplayMode(AUX_RGB | AUX_DEPTH | AUX_DOUBLE);
	auxInitWindow("Controls");
	auxIdleFunc(display);
	auxReshapeFunc(resize);

	glEnable(GL_DEPTH_TEST);
	glEnable(GL_COLOR_MATERIAL);
	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);

	glLightfv(GL_LIGHT0, GL_POSITION, pos);
	glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, dir);

	glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
	glMaterialf(GL_FRONT, GL_SHININESS, 128.0);

	auxKeyFunc(AUX_LEFT, Key_LEFT);
	auxKeyFunc(AUX_RIGHT, Key_RIGHT);
	auxKeyFunc(AUX_UP, Key_UP);
	auxKeyFunc(AUX_DOWN, Key_DOWN);
	auxMouseFunc(AUX_LEFTBUTTON, AUX_MOUSELOC, mouse);

	auxMainLoop(display);
}
示例#5
0
void main(int argc,char **argv) 
{
	if(Args(argc,argv)==GL_FALSE)auxQuit();

	windW=600;
	windH=300;
	auxInitPosition(0,0,windW,windH);
	
	windType|=(rgb)?AUX_RGB:AUX_INDEX;
	windType|=(doubleBuffer)?AUX_DOUBLE:AUX_SINGLE;

	auxInitDisplayMode(windType);

	if(auxInitWindow("Primitive Test")==GL_FALSE)auxQuit();

	Init();
	auxExposeFunc((AUXEXPOSEPROC)Resize);
	auxReshapeFunc((AUXRESHAPEPROC)Resize);
	auxKeyFunc(AUX_1,KeyPress1);
	auxKeyFunc(AUX_2,KeyPress2);
	auxKeyFunc(AUX_3,KeyPress3);
	auxMainLoop(Paint);
}
示例#6
0
int main( int argc, const char *argv[] )
{
  // reads model into global glb_model;
  ON::Begin();

  ON_TextLog error_log;

  ON_BOOL32 bOK;
  int window_width  = 500;
  int window_height = 500;
  //double port_aspect = ((double)window_width)/((double)window_height);

  // read the file into model
  if ( argc != 2 ) {
    printf("Syntax: %s filename.3dm\n",argv[0] );
    return 0;
  }
  const char* sFileName = argv[1];
  printf("\nFile:  %s\n", sFileName );

  // read the file
  CModel model;
  if ( !model.Read( sFileName, &error_log ) )
  {
    // read failed
    error_log.Print("Unable to read file %s\n",sFileName);
    return 1;
  }

  glb_model = &model;

  // set bbox = world bounding box of all the objects
  model.m_bbox = model.BoundingBox();
  if ( !model.m_bbox.IsValid() )
  {
    // nothing to look at in this model
    return 2;
  }

  // set model.m_view
  if ( model.m_settings.m_views.Count() > 0 )
  {
    // use first viewport projection in file
    double angle;
    model.m_view.m_vp = model.m_settings.m_views[0].m_vp;
    model.m_view.m_target = model.m_settings.m_views[0].m_target;
    model.m_view.m_vp.GetCameraAngle( &angle );
    model.m_view.m_vp.Extents( angle, model.m_bbox );
  }
  else 
  {
    GetDefaultView( model.m_bbox, model.m_view );
  }

  // If needed, enlarge frustum so its aspect matches the window's aspect.
  // Since the Rhino file does not store the far frustum distance in the
  // file, viewports read from a Rhil file need to have the frustum's far
  // value set by inspecting the bounding box of the geometry to be
  // displayed.

  
  ///////////////////////////////////////////////////////////////////
  //
  // GL stuff starts here
  //
  for(;;) {  
    
#if defined(ON_EXAMPLE_GL_USE_GLAUX)
    wchar_t sWindowTitleString[256];
#endif
#if defined(ON_EXAMPLE_GL_USE_GLUT)
    char sWindowTitleString[256];
#endif
    sWindowTitleString[255] = 0;
    if ( argv[0] && argv[0][0] )
    {
      int i;
      for ( i = 0; i < 254 && argv[0][i]; i++ )
        sWindowTitleString[i] = argv[0][i];
      sWindowTitleString[i] = 0;
    }

#if defined(ON_EXAMPLE_GL_USE_GLAUX)
    auxInitPosition( 0, 0, window_width, window_height );
    auxInitDisplayMode( AUX_SINGLE | AUX_RGB | AUX_DEPTH );
    auxInitWindow( sWindowTitleString );

    // register event handler functions
    auxIdleFunc( 0 );
    auxReshapeFunc( myGLAUX_Reshape );
    auxMouseFunc( AUX_LEFTBUTTON,   AUX_MOUSEDOWN, myGLAUX_MouseLeftEvent );
    auxMouseFunc( AUX_LEFTBUTTON,   AUX_MOUSEUP,   myGLAUX_MouseLeftEvent );
    auxMouseFunc( AUX_MIDDLEBUTTON, AUX_MOUSEDOWN, myGLAUX_MouseMiddleEvent );
    auxMouseFunc( AUX_MIDDLEBUTTON, AUX_MOUSEUP,   myGLAUX_MouseMiddleEvent );
    auxMouseFunc( AUX_RIGHTBUTTON,  AUX_MOUSEDOWN, myGLAUX_MouseRightEvent );
    auxMouseFunc( AUX_RIGHTBUTTON,  AUX_MOUSEUP,   myGLAUX_MouseRightEvent );
    auxKeyFunc( AUX_LEFT,  myKeyLeftArrowEvent );
    auxKeyFunc( AUX_RIGHT, myKeyRightArrowEvent );
    auxKeyFunc( AUX_UP,    myKeyUpArrowEvent );
    auxKeyFunc( AUX_DOWN,  myKeyDownArrowEvent );
    auxKeyFunc( AUX_E,  myKeyViewExtents );
    auxKeyFunc( AUX_e,  myKeyViewExtents );
    auxKeyFunc( AUX_Z,  myKeyViewExtents );
    auxKeyFunc( AUX_z,  myKeyViewExtents );
#endif

#if defined(ON_EXAMPLE_GL_USE_GLUT)
    glutInit(&argc,(char**)argv);
    glutInitWindowPosition( 0, 0);
    glutInitWindowSize( window_width, window_height );
    glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH );
    glutCreateWindow( sWindowTitleString );

    // register event handler functions
    glutIdleFunc( 0 );
    glutReshapeFunc( myGLUT_Reshape );
    glutMouseFunc( myGLUT_MouseEvent );
    glutKeyboardFunc( myGLUT_KeyboardEvent );
    glutSpecialFunc( myGLUT_SpecialKeyEvent );
    glutDisplayFunc( myDisplay );
#endif

    // setup model view matrix, GL defaults, and the GL NURBS renderer
    GLUnurbsObj* pTheGLNURBSRender = NULL; // OpenGL NURBS rendering context
    bOK = myInitGL( model.m_view.m_vp, pTheGLNURBSRender );

    if ( bOK ) {
      // build display list
      myBuildDisplayList( glb_display_list_number,
                          pTheGLNURBSRender,
                          model );

      // look at it
#if defined(ON_EXAMPLE_GL_USE_GLAUX)
      auxMainLoop( myDisplay );
#endif

#if defined(ON_EXAMPLE_GL_USE_GLUT)
      glutMainLoop(  );
#endif

    }

    gluDeleteNurbsRenderer( pTheGLNURBSRender );

    break;
  }

  //
  // GL stuff ends here
  //
  ///////////////////////////////////////////////////////////////////

  ON::End();

  return 0;
}
示例#7
0
文件: BZPhase.c 项目: RedAndr/BZPhase
int main(int pn, char **ps){
  int i,j,pxc,c;
  double sx,second[4];
  FILE *ic;
  char ss[60];

  puts(" ###############################################################################");
  puts(" # BZPhaseFlow -  Phase Portraits Builder of the Belousov-Zhabotinsky reaction #");
  puts(" # Copyright (C) Andrew B. Ryzhkov and Arcady V. Antipin, 1997-2006. Ver. 2.00 #");
  puts(" # Ufa,      Institute of Organic Chemistry,   Laboratory of Chemical Kinetics #");
  puts(" # Montreal, McGill University, Department of Oceanic and Atmospheric Sciences #");
  puts(" # E-Mail: [email protected]                         WWW: http://RedAndr.ca/bz #");
  puts(" ###############################################################################");
                                                                                      
  SetConsoleTitle("BZPhaseFlow 2.00");                                                    
                                                                                      
  /* for Borland */
//  _clear87();
//  _control87(MCW_EM, MCW_EM);  /* defined in float.h */

  if(pn<2) {                                                                          
    ic=fopen("BZPhase.dat","rt");                                                     
    if(ic!=NULL) {
ReadData:
      do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%le",&BegRange);
      do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%d" ,&NumPoints);
      do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%le",&DeltaSolve);
      do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%le",&ep); tor=ep;

      for(i=0;i<nk;i++) { do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%le",&k[i]);}
      for(i=0;i<n ;i++) { do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%le",&x[i]);}
      for(i=0;i<n ;i++) { do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%le",&flowc0[i]);}

      printf("BegRange = %5.0f, NumPoints = %6d, DeltaSolve = %2.2f, Precision = %9.2E\n",  BegRange,NumPoints,DeltaSolve,ep);
      for(i=0;i<n ;i++) printf("k[%2d] = %E, c0[%2d] = %E, flowc0[%2d] = %E\n", i+1, k[i], i+1, x[i], i+1, flowc0[i]);
      for(i=n;i<nk;i++) printf("k[%2d] = %E\n", i+1, k[i]);

      do fgets(ss,80,ic); while(ss[0]==';'); sscanf(ss,"%le",&xflow);                           // flow parametr
      printf("Flow parameter = %14.8E\n", xflow);

      fclose(ic);
    } else if(errno==2) {
      help();
      return 1;
    } else {
      printf("Error opening file 'bzphase.dat' #%d\n",errno);
      return 2;
    }
  } else {
    if(pn>2) {
      puts("Opening file");
      ic=fopen(ps[1],"rt");
      if(ic==NULL) { printf("Error opening file '%s' #%d",ps[1],errno); return 2; }
      pm=malloc(pmax*sizeof(float)*4);
      if( pm == NULL ) {
        puts( "Unable to allocate memory\n" );
        return -1;
      }
      puts("Reading file");
      j=0;
      do {
        fscanf(ic,"%le %le %le %le",&t,&p(j,0),&p(j,1),&p(j,2));
        j++;
        if (j%100==0) printf("\r %d",j);
        fflush(stdout);
        if (j==pmax) break;
      } while (!feof(ic));
      fclose(ic);
      printf("\n%d points is readout\n",j-1);
      goto Show;
    } else {
      ic=fopen(ps[1],"rt");
      if(ic!=NULL) goto ReadData;
      printf("Error opening file '%s' #%d\n",ps[1],errno);
      return 2;
    }
  }

  tor=ep;
  for(i=0;i<n;i++) yy[i]=x[i];          // begin concs

  printf("Calculate begining range: %10.2f",BegRange);  fflush(stdout);
  Delta=BegRange;
  second[0]=(double)(GetTickCount())/1000;
  stepx();
  second[1]=(double)(GetTickCount())/1000;
  printf("\n");

  for(i=0;i<n ;i++) printf("c[%2d] = %20.12E\n",i+1,yy[i]);

  i=NumPoints*sizeof(float)*4;
  printf("Allocate %d bytes memory for %d points\n",i,NumPoints);
  pm=malloc(i);
  if( pm == NULL ) {
    puts( "Unable to allocate memory\n" );
    return -1;
  }

  Delta=DeltaSolve;  mj=NumPoints;  mmj=(int)(t+mj*Delta);
  printf("Calculate until %d \n",mmj);
  second[2]=(double)(GetTickCount())/1000;
  for (j=0;j<mj;j++) {
        p(j,0)= (float)yy[2];                // Br-  2
        p(j,1)= (float)yy[5];                // Me   5
        p(j,2)= (float)yy[7];                // Br2  7
        p(j,3)= (float)yy[9];                // Br'  9
//printf("%e %e %e %e\n",t,yy[2],yy[5],yy[7],yy[9]);
    if (j%1000==0) {printf("\r %6.2f %%",t*100/mmj); fflush(stdout);}
    stepx();
  }
  second[3]=(double)(GetTickCount())/1000;
  printf("\nCalculation complete, elapsed time: %10.3f and %10.3f seconds\n",second[1]-second[0],second[3]-second[2]);
  stp=ms[6];  fun=ms[7];  jac=ms[8];  lum=ms[9];  slt=ms[10];
  printf("Funs: %d Jacs: %d LUm: %d Slt: %d Steps: %d\n",fun,jac,lum,slt,stp);

Show:
   pixcount=j-1;
   pxc=pixcount;

   puts("Search Max&Min");
   maxpx=minpx=p(0,0);
   maxpy=minpy=p(0,1);
   maxpz=minpz=p(0,2);
   maxpw=minpw=p(0,3);
   for(c=1;c<pxc;c++) {
           sx=p(c,0); if(sx>maxpx) maxpx=sx; else if(sx<minpx) minpx=sx;
           sx=p(c,1); if(sx>maxpy) maxpy=sx; else if(sx<minpy) minpy=sx;
           sx=p(c,2); if(sx>maxpz) maxpz=sx; else if(sx<minpz) minpz=sx;
           sx=p(c,3); if(sx>maxpw) maxpw=sx; else if(sx<minpw) minpw=sx;
   }
   printf("Min[2]=%E Max[2]=%E\n",minpx,maxpx);
   printf("Min[5]=%E Max[5]=%E\n",minpy,maxpy);
   printf("Min[7]=%E Max[7]=%E\n",minpz,maxpz);
   printf("Min[9]=%E Max[9]=%E\n",minpw,maxpw);
   
   if(fabs(maxpx-minpx)<1e-10 && fabs(maxpy-minpy)<1e-10 && fabs(maxpz-minpz)<1e-10) {
     puts("I am sorry, but you have the attracting point only.");
     return 1;
   }

   puts("Stretching");
   for(c=0;c<pxc;c++) {
     p(c,0)=(p(c,0)-minpx)/(maxpx-minpx)-0.5;
     p(c,1)=(p(c,1)-minpy)/(maxpy-minpy)-0.5;
     p(c,2)=(p(c,2)-minpz)/(maxpz-minpz)-0.5;
     p(c,3)=(p(c,3)-minpw)/(maxpw-minpw);
   }

   maxcor=1;

   puts("Go to graph");
   help();
   printf("Flow parameter = %14.8E\n", xflow);
   fflush(stdout);
   
   auxInitDisplayMode (AUX_DOUBLE | AUX_RGB | AUX_ACCUM | AUX_DEPTH24);
   auxInitPosition (0, 0, 700, 700);
   auxInitWindow ("BZPhase");

   if (myinit()!=0) {
     puts("Error OpenGL initialization.");
     return 2;
   };

  auxReshapeFunc (myReshape);
  auxKeyFunc (AUX_UP,      rotx1);
  auxKeyFunc (AUX_DOWN,    rotx2);
  auxKeyFunc (AUX_LEFT,    roty1);
  auxKeyFunc (AUX_RIGHT,   roty2);
  auxKeyFunc (AUX_SPACE,   move0);
  auxKeyFunc (AUX_x,       rotz1);
  auxKeyFunc (AUX_z,       rotz2);
  auxKeyFunc (AUX_1,        dis1);
  auxKeyFunc (AUX_2,        dis2);
  auxKeyFunc (AUX_3,        dis3);
  auxKeyFunc (AUX_4,    glmodesw);
  auxKeyFunc (AUX_v,      psize1);
  auxKeyFunc (AUX_c,      psize2);

  auxKeyFunc (AUX_d,      movex1);
  auxKeyFunc (AUX_a,      movex2);
  auxKeyFunc (AUX_w,      movey1);
  auxKeyFunc (AUX_s,      movey2);
  auxKeyFunc (AUX_q,      movez1);
  auxKeyFunc (AUX_e,      movez2);

  auxKeyFunc (AUX_m,      scale);
  auxKeyFunc (AUX_p,      print);

  auxKeyFunc (AUX_r,      par1);
  auxKeyFunc (AUX_t,      par2);
  auxKeyFunc (AUX_y,      par3);
  auxKeyFunc (AUX_u,      par4);
  auxKeyFunc (AUX_i,      par5);
  auxKeyFunc (AUX_o,      par6);

  auxKeyFunc (AUX_f,      par7);
  auxKeyFunc (AUX_g,      par8);
  auxKeyFunc (AUX_h,      par9);
  auxKeyFunc (AUX_j,      para);
  auxKeyFunc (AUX_k,      parb);
  auxKeyFunc (AUX_l,      parc);

  auxMouseFunc (AUX_LEFTBUTTON , AUX_MOUSEUP,   Mouse_leftup);
  auxMouseFunc (AUX_LEFTBUTTON , AUX_MOUSELOC,  Mouse_move);
  auxIdleFunc  (Calc);

  auxMainLoop(display);

  return(0);
}
示例#8
0
CEE3DINPROC_API void _stdcall CeE3DKeyFunc(int k, CEE3DKEYPROC proc) {
	auxKeyFunc(k, proc); 
}
示例#9
0
void main (int argc, char** argv)
{
	int Message_counter ; /* counter for message packing */
	int My_tid ; /* my task id */

	/* show start up message */
	printf ("\n-=> Fractal Terrain Engine version 2.1 release 2 <=-\n\n") ;

	/* read the config files */
	read_config (argc,argv) ;

	/* set up the pixel buffer and it's variables */ 
	Pixel_buffer_width=User_view.X_size/Number_of_workers;
	Pixel_buffer_size=
		Pixel_buffer_width*User_view.Y_size*3*sizeof(unsigned char) ;
	Pixel_buffer=(unsigned char *) malloc(Pixel_buffer_size) ;

	/* set up worker tids array */
	Worker_tids=(int *)malloc(Number_of_workers*sizeof(int)) ;

	/* set up the image buffer */
	Image_buffer=(unsigned char *) malloc 
		((User_view.X_size*User_view.Y_size*3*sizeof(unsigned char))) ;

	/* start up pvm */
	if ((My_tid = pvm_mytid()) < 0) 
	{
		exit(1);
	}
	/* start up the workers */

	pvm_spawn(WORKER_NAME,(char**)0,PvmTaskDefault,"",
		Number_of_workers,Worker_tids) ;

	printf ("INFO:Spawned %i Workers\n",Number_of_workers) ;

	/* tell the worker what values to use for the terrain function */
	pvm_initsend(PvmDataDefault) ;

	pvm_pkdouble(&H,1,1) ;
	pvm_pkdouble(&Lacunarity,1,1);
	pvm_pkdouble(&Octaves,1,1);
	pvm_pkdouble(&Offset,1,1) ;

	pvm_pkfloat(&Ambient_light,1,1) ;

	pvm_pkfloat(&Fog.Red,1,1) ;
	pvm_pkfloat(&Fog.Green,1,1);
	pvm_pkfloat(&Fog.Blue,1,1) ;

	pvm_pkfloat(&Sky.Red,1,1) ;
	pvm_pkfloat(&Sky.Green,1,1) ;
	pvm_pkfloat(&Sky.Blue,1,1) ;

	pvm_pkfloat(&Horizon.Red,1,1) ;
	pvm_pkfloat(&Horizon.Green,1,1) ;
	pvm_pkfloat(&Horizon.Blue,1,1) ;

	pvm_pkdouble(Colour_boundaries,NUMBER_OF_TERRAIN_COLOURS,1) ;

	for ( Message_counter = 0 ;
		Message_counter<NUMBER_OF_TERRAIN_COLOURS ;
		Message_counter++ )
	{
		pvm_pkfloat(&Terrain_colours[Message_counter].Red,1,1) ;
		pvm_pkfloat(&Terrain_colours[Message_counter].Green,1,1) ;
		pvm_pkfloat(&Terrain_colours[Message_counter].Blue,1,1) ;
	}

	pvm_pkdouble(&Fog_start,1,1) ;
	pvm_pkdouble(&Fog_end,1,1) ;

	/* tell the worker what values to use for the display */
	pvm_pkdouble(&Ray_step,1,1) ;
	pvm_pkdouble(&X_view_angle,1,1) ; 
	pvm_pkdouble(&Y_view_angle,1,1) ;
	pvm_pkint(&Pixel_buffer_width,1,1) ;
	pvm_pkint(&User_view.Y_size,1,1) ;
	pvm_pkdouble(&X_ray_angle,1,1) ;
	pvm_pkdouble(&Y_ray_angle,1,1) ;

	/* send the message to all the workers */
	pvm_mcast (Worker_tids,Number_of_workers,INFO) ;

	/* set up light source */
	normalize_3d(Light_source) ;

	/* set the light source */
	Light_source[0]=0.1 ;
	Light_source[1]=0.4 ;
	Light_source[2]=0.3 ;

	/* tell the worker what values to use for the light source */
	pvm_initsend(PvmDataDefault) ;
	pvm_pkdouble(Light_source,3,1) ;
	pvm_mcast (Worker_tids,Number_of_workers,NEW_LIGHT_SOURCE) ;

	/* set up the users view point */
	Height=1.0 ;
	User.X=0 ;
	User.Y=0 ;
	User.Z=Height ;
	User.X_angle=0.0 ;
	User.Y_angle=0.0 ;
	User.Z_angle=0.0 ;

	/* set up window */
	open_window() ;
	print_keys() ;

	/*									*/
	/* set up the keyboard,Reshape and display routines			*/
	/*									*/
	auxKeyFunc(AUX_Q,kill_workers) ;
	auxKeyFunc(AUX_q,kill_workers) ;
	auxKeyFunc(AUX_ESCAPE,kill_workers) ;   

	auxKeyFunc(AUX_LEFT,left) ;
	auxKeyFunc(AUX_RIGHT,right) ;
	auxKeyFunc(AUX_UP,forwards) ;
	auxKeyFunc(AUX_DOWN,backwards) ;
	auxKeyFunc(AUX_a,up) ;
	auxKeyFunc(AUX_A,up) ;
	auxKeyFunc(AUX_Z,down) ;
	auxKeyFunc(AUX_z,down) ;

	auxKeyFunc(AUX_J,save_image) ;
	auxKeyFunc(AUX_j,save_image) ;

	auxMainLoop(display_loop) ;

}