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


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

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


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

示例1: Assembly

Assembly *GraspGLObjects::CreateSuccessIndicator( void ) {
	Assembly	*assembly = new Assembly();
	Sphere		*sphere = new Sphere( prompt_radius );
	sphere->SetColor( GREEN );
	assembly->AddComponent( sphere );
	return assembly;
}
开发者ID:PsyPhy,项目名称:GRASPonISS,代码行数:7,代码来源:GraspGLObjects.cpp

示例2: fopen

MarkerStructureGLObject::MarkerStructureGLObject( char *model_file ) {

	if ( model_file ) {
		FILE *fp = fopen( model_file, "r" );
		fAbortMessageOnCondition( ( NULL == fp ), "ReadModelMarkerPositions()", "Error opening %s for read.", model_file );
		int mrk;
		for ( mrk = 0; mrk < MAX_MARKERS; mrk++ ) {
			int id, items;
			double x, y, z;
			items = fscanf( fp, "%d %lf\t %lf\t %lf", &id, &x, &y, &z );
			if ( items != 4  ) break;
			fAbortMessageOnCondition( ( id < 0 || id >= MAX_MARKERS ), "ReadModelMarkerPositions()", "Marker %d ID = %d out of range [0 %d].", mrk, id, MAX_MARKERS - 1 );
			modelMarker[mrk].id = id;
			modelMarker[mrk].position[X] = x;
			modelMarker[mrk].position[Y] = y;
			modelMarker[mrk].position[Z] = z;
		}
		nModelMarkers = mrk;	
		fclose( fp );
	}
	else nModelMarkers = 0;
	modelMarkerBalls = new Assembly();
	for ( int mrk = 0; mrk < nModelMarkers; mrk++ ) {
		Sphere *sphere = new Sphere( STRUCTURE_BALL_RADIUS );
		sphere->SetPosition( modelMarker[mrk].position );
		sphere->SetColor( 0.0, 1.0, 0.0, 1.0 );
		modelMarkerBalls->AddComponent( sphere );
	}
	AddComponent( modelMarkerBalls );
	realMarkerBalls = new Assembly();
	for ( int mrk = 0; mrk < nModelMarkers; mrk++ ) {
		Sphere *sphere = new Sphere( STRUCTURE_BALL_RADIUS );
		sphere->SetPosition( modelMarker[mrk].position );
		sphere->SetColor( 0.5, 0.0, 0.5, 1.0 );
		realMarkerBalls->AddComponent( sphere );
	}
	AddComponent( realMarkerBalls );
	HideRealMarkers();

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

示例3: Sphere

/*
 * RayTracer class
 */
RayTracer::RayTracer()
{
	const int spheresPerDimension = 3;

	// create objects
	for(int x = 0; x < spheresPerDimension; ++x) {
		for(int y = 0; y < spheresPerDimension; ++y) {
			for(int z = 0; z < spheresPerDimension; ++z) {
				if(((x+y+z) % 3) == 0)
					continue;

				Sphere *sphere = new Sphere(1.0f);
				sphere->SetReflectance(0.2f);
				sphere->SetOrigin(Vector((float)x, (float)y, (float)z) * 2.5f + Vector(-2.5f, -2.5f, 0.0f));
				sphere->SetColor((x % 2) ? 1.0f : 0.5f, (y % 2) ? 1.0f : 0.5f, (z % 2) ? 1.0f : 0.5f);
				objects.insert(objects.end(), sphere);
			}
		}
	}
}
开发者ID:joshb,项目名称:raytracer,代码行数:23,代码来源:raytracer.cpp


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