当前位置: 首页>>代码示例>>C++>>正文


C++ Cylinder::SetColor方法代码示例

本文整理汇总了C++中Cylinder::SetColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Cylinder::SetColor方法的具体用法?C++ Cylinder::SetColor怎么用?C++ Cylinder::SetColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cylinder的用法示例。


在下文中一共展示了Cylinder::SetColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Assembly

Assembly *GraspGLObjects::CreateRoom( void ) {

	Assembly *structure = new Assembly();
	structure->SetColor( BLACK );

	// Tunnel
	tunnel = new Assembly();
	Cylinder *cylinder = new Cylinder( room_radius, room_radius, room_length, room_facets );
	cylinder->SetColor( WHITE );
	cylinder->SetTexture( wall_texture );
	cylinder->SetOrientation( 90.0, 0.0, 0.0 );
	tunnel->AddComponent( cylinder );
	// Reference Bars 
	double bar_length = room_length - 5.0 * reference_bar_radius;
	for (int i=0; i < reference_bars; i++ ){ 
		Cylinder *referenceBar = new Cylinder( reference_bar_radius, reference_bar_radius, bar_length, reference_bar_facets );
		referenceBar->SetOffset( room_radius, 0.0, 0.0 );
		referenceBar->SetOrientation( 90.0 + 180 * (float) i / (float) reference_bars, referenceBar->kVector );
		referenceBar->SetColor(  1.0 - (double) i / reference_bars, 1.0f - (double) i / reference_bars, 1.0f - (double) i / reference_bars, 1.0 );
		// The texturing on the bars may be commented out for the moment because it lengthens the rendering time too much.
		referenceBar->SetTexture( references_texture );
		tunnel->AddComponent( referenceBar );
		referenceBar = new Cylinder( reference_bar_radius, reference_bar_radius, bar_length, reference_bar_facets );
		referenceBar->SetOffset( room_radius, 0.0, 0.0 );
		referenceBar->SetOrientation( - 90.0 + 180 * (float) i / (float) reference_bars, referenceBar->kVector );
		referenceBar->SetColor(  (double) i / reference_bars, (double) i / reference_bars, (double) i / reference_bars, 1.0 );
		// See above.
		referenceBar->SetTexture( references_texture );
		tunnel->AddComponent( referenceBar );
	}
	structure->AddComponent( tunnel );

	Sphere *sphere = new Sphere( target_ball_radius );
	sphere->SetPosition( 0.0, 0.0, room_length / 2.0 );
	sphere->SetColor( RED );
	structure->AddComponent( sphere );

	return structure;
}
开发者ID:PsyPhy,项目名称:GRASPonISS,代码行数:39,代码来源:GraspGLObjects.cpp

示例2: Cylinder

MeterStick::MeterStick( void ) {

  double stick_radius = 25.0;

  Cylinder *cylinder;
  Disk *disk;

  cylinder = new Cylinder( stick_radius, stick_radius, 200.0 );
  cylinder->SetColor( RED );
  AddComponent( cylinder );
  cylinder = new Cylinder( stick_radius, stick_radius, 200.0 );
  cylinder->SetOffset( 0.0, 0.0, 200.0 );
  cylinder->SetColor( WHITE );
  AddComponent( cylinder );
  cylinder = new Cylinder( stick_radius, stick_radius, 200.0 );
  cylinder->SetOffset( 0.0, 0.0, 400.0 );
  cylinder->SetColor( RED );
  AddComponent( cylinder );
  cylinder = new Cylinder( stick_radius, stick_radius, 200.0 );
  cylinder->SetOffset( 0.0, 0.0, 600.0 );
  cylinder->SetColor( WHITE );
  AddComponent( cylinder );
  cylinder = new Cylinder( stick_radius, stick_radius, 200.0 );
  cylinder->SetOffset( 0.0, 0.0, 800.0 );
  cylinder->SetColor( RED );
  AddComponent( cylinder );

  cylinder = new Cylinder( stick_radius / 2.0, stick_radius / 2.0, 100.0 );
  cylinder->SetAttitude( 90.0, j_vector );
  cylinder->SetColor( BLACK );
  AddComponent( cylinder );

  cylinder = new Cylinder( stick_radius / 2.0, stick_radius / 2.0, 100.0 );
  cylinder->SetAttitude( 90.0, j_vector );
  cylinder->SetPosition( 0.0, 0.0, 1000.0 - stick_radius );
  cylinder->SetColor( BLACK );
  AddComponent( cylinder );

  disk = new Disk( stick_radius );
  disk->SetPosition( 0.0, 0.0, 990.0 );
  disk->SetColor( RED );
  AddComponent( disk );

}
开发者ID:frenchjam,项目名称:DexSourceCode,代码行数:44,代码来源:AfdObjects.cpp


注:本文中的Cylinder::SetColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。