Example #1
0
Assembly *GraspGLObjects::CreateStarrySky( void ) {
	Assembly *sky = new Assembly();
	Patch *patch = new Patch( room_radius * 4.4, room_radius * 4.4 );
	patch->SetTexture( sky_texture );
	sky->AddComponent( patch );
	sky->SetColor(WHITE);
	return( sky );
}
Example #2
0
Assembly *GraspGLObjects::CreateDarkSky( void ) {
	Assembly *darkSky = new Assembly();
	Patch *patch = new Patch( room_radius * 2.2, room_radius * 2.2 );
	patch->SetTexture( sky_texture );// there is something strange if I dont put the texture the ligthing of the whole tunnel changes
	darkSky->AddComponent( patch );
	darkSky->SetColor( BLACK );
	darkSky->enabled = false;
	return( darkSky );
}
Example #3
0
Dial::Dial ( void ) {

  thickness = 10.0;
  radius = 100.0;
  tilt = 30.0;
  label_width = 50.0;

  Slab *slab;
  Disk *disk;
  Cylinder *cylinder;
  Patch *rectangle;
	char path[1024];

	sprintf( path, "%s%s", AfdTexturePath, "bmp\\ten.bmp" );
  ten_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
	sprintf( path, "%s%s", AfdTexturePath, "bmp\\five.bmp" );
  five_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
	sprintf( path, "%s%s", AfdTexturePath, "bmp\\zero.bmp" );
  zero_texture = new Texture( path, label_width / 2.0, label_width / 2.0 );
	sprintf( path, "%s%s", AfdTexturePath, "bmp\\meters.bmp" );
  meters_texture = new Texture( path, label_width * 2.0, label_width / 2.0 );
  
  needle = new Slab( thickness / 4.0, 0.90 * radius, thickness / 2.0 );
  needle->SetOffset( 0.0, radius / 2.0, thickness / 2.0 );
  needle->SetColor( ORANGE );
  AddComponent( needle );

  rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
  rectangle->SetPosition( radius + label_width / 2.0, 0.0, 0.0 );
  rectangle->SetTexture( ten_texture );
  AddComponent( rectangle );

  rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
  rectangle->SetPosition( 0.0, radius + label_width / 2.0, 0.0 );
  rectangle->SetTexture( five_texture );
  AddComponent( rectangle );

  rectangle = new Patch( label_width / 2.0 , label_width / 2.0 );
  rectangle->SetPosition( - ( radius + label_width / 2.0 ), 0.0, 0.0 );
  rectangle->SetTexture( zero_texture );
  AddComponent( rectangle );

  rectangle = new Patch( 2 * label_width , label_width / 2.0 );
  rectangle->SetPosition( 0.0, - radius - label_width / 2.0, 0.0 );
  rectangle->SetTexture( meters_texture );
//  AddComponent( rectangle );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -18.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -36.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -54.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -72.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( -90.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 18.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 36.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 54.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 72.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  slab = new Slab( thickness / 6.0, radius / 5.0, thickness / 4.0 );
  slab->SetOffset( 0.0, radius / 2.0 + radius * 4.0 / 10.0, thickness / 2.0 );
  slab->SetOrientation( 90.0, k_vector );
  slab->SetColor( BLACK );
  AddComponent( slab );

  disk = new Disk( radius );
  AddComponent( disk );
  cylinder = new Cylinder( radius, radius, thickness );
  AddComponent( cylinder );
  
  SetColor( CYAN );
  SetAttitude( tilt, i_vector );

  minimum = 0.0;
  maximum = 10000;

}