本文整理汇总了C++中Cylinder::SetOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ Cylinder::SetOrientation方法的具体用法?C++ Cylinder::SetOrientation怎么用?C++ Cylinder::SetOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cylinder
的用法示例。
在下文中一共展示了Cylinder::SetOrientation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}