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


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

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


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

示例1: init

void init (void) 
{
	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_NORMALIZE);
	glCullFace(GL_BACK);
	glEnable(GL_COLOR_MATERIAL);
	glEnable(GL_TEXTURE_2D);

	skybox = SpaceWall();
	table = TableSurface();
	
	sun = Sun(0.0f , 13.0f , 0.0f);
	centralPole = Cylinder(0,8.0f,0 ,0.54f , 12.0f , 30);
	
	baseBox = Box(0,1.01f,0 , 10,10,2);
	coverBox = Box(0,3.2f,3.8f , 10,1,0.5);
	coverBox2 = Box(0,3.2f,-3.8f , 10,1,0.5);
	coverBox3 = Box(4.4f,3.3f,0 , 9,1,0.5);
	coverBox3.setAngle(90 ,180 , 90);
	coverBox4 = Box(-4.4f,3.3f,0 , 9,1,0.5f);
	coverBox4.setAngle(90 ,180 , 90);
	
	mainGear = Gear(0 ,2.3f ,0 , 0.5f , 4.0f ,  0.4f , 50 ,0.35f);
	bigPowerGear = Gear(-4.3f ,2.8f ,3.8f , 0.2f , 4.0f ,  0.4f , 50 ,0.35f);
	powerGear = Gear(4.3f ,2.3f ,3.8f , 0.2f , 1.6f ,  0.4f , 20 ,0.35f);
	smallMiddleGear = Gear(0 ,2.8f ,0 , 0.5f , 1.6f ,  0.4f , 20 ,0.35f);
	sideGear = Gear(5.9f ,1.5f ,3.8f , 0.2f , 0.7f ,  0.2f , 10 ,0.35f);
	sidePole = Cylinder(5.9f ,1.5f ,3.8f ,0.18f , 2.0f , 30);
	sidePole.setAngle(180 ,90 ,0);
	sideGear.setAngle(180 ,90 ,0);
	
	saturnRingPole = Cylinder(4.3f ,3.3f ,3.8f ,0.04f , 4.3f , 20);
	saturnRingPole.setAngle(0,0 ,0);
	
	powerPole = Cylinder(4.3f ,3.3f ,3.8f ,0.18f , 2.0f , 30);
	powerPole2 = Cylinder(-4.3f ,3.3f ,3.8f ,0.18f , 2.0f , 30);
	powerPole3 = Cylinder(-4.3f ,3.3f ,-3.8f ,0.18f , 2.0f , 30);
	powerPole4 = Cylinder(4.3f ,3.3f ,-3.8f ,0.18f , 2.0f , 30);
	
	moonCylinder = Cylinder(-4.3f ,3.3f ,2.0f ,0.3f, 1.0f , 30);

	neptunePole = Cylinder(0,4.62f,0 ,0.9f , 3.3f , 30);
	uranusPole = Cylinder(0,5.0f,0 ,0.8f , 3.5f , 30);
	saturnPole = Cylinder(0,5.4f,0 ,0.7f , 3.7f , 30);
	jupiterPole = Cylinder(0,5.8f,0 ,0.6f , 3.9f , 30);
	marsPole = Cylinder(0,6.2f,0 ,0.5f , 4.1f , 30);
	earthPole = Cylinder(0,6.58f,0 ,0.4f , 4.3f , 30);
	venusPole = Cylinder(0,6.96f,0 ,0.3f , 4.5f , 30);
	mercuryPole = Cylinder(0,8,0 ,0.2f , 5.0f , 30);

	saturnRing = SaturnRing(0 ,11.0f ,0 ,2.4f , 0.2f , 30);
	saturnRing.yAngle = -12;
	
	setUpPlanet(mercury , 5 ,4.1f ,9.5f , 0.4f , "Textures\\mercury.bmp");
	setUpPlanet(venus , 10 ,1.62f ,9.0f , 1.0f ,  "Textures\\venus.bmp");
	setUpPlanet(earth , 15 ,1 ,8.5f , 1.0 ,  "Textures\\earth.bmp");
	setUpPlanet(mars , 20 ,0.53f ,8.0f , 0.53f ,  "Textures\\mars.bmp");
	setUpPlanet(jupiter , 25 ,0.08f ,7.5 , 2.0f ,  "Textures\\jupiter.bmp");
	setUpPlanet(saturn , 30 ,0.0339f ,7.0f , 1.5f ,  "Textures\\saturn.bmp");
	setUpPlanet(uranus , 35 ,0.011f ,6.5f , 1.2f ,  "Textures\\uranus.bmp");
	setUpPlanet(neptune , 40 ,0.006f ,6.0f , 1.2f,  "Textures\\neptune.bmp");
	setUpPlanet(moon , 2 ,13 ,8.8f  , 0.3f ,  "Textures\\moon.bmp");

	//Earths Tilt
	earth.planet.setAngle(-90,23.5,0);
}
开发者ID:Stewart-Taylor,项目名称:GraphicsAssignment1,代码行数:68,代码来源:Main.cpp


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