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


C++ CoordinateSystem::setCamera方法代码示例

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


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

示例1: display

void display()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	// clear the screen - any drawing before here will not display

	glLoadIdentity();
	// set up the camera here
    camera.setCamera();

	// camera is set up - any drawing before here will display incorrectly
    
    // Draw Skybox
    glPushMatrix();
        glTranslatef(camera.getPosition().x,
                     camera.getPosition().y,
                     camera.getPosition().z);
        glDepthMask(GL_FALSE);
        skybox.draw();
        glDepthMask(GL_TRUE);
    glPopMatrix();

    // Draw Saturn
    glPushMatrix();
        glTranslatef(saturnInfo.x, 0.f, saturnInfo.z);
        glScalef(saturnInfo.radius, saturnInfo.radius, saturnInfo.radius);
        saturn.draw();
    glPopMatrix();
    
    // Draw Moons
    for (int i = 0; i < 10; i++)
    {
        glPushMatrix();
            glTranslatef(moonInfo[i].x, 0.f, moonInfo[i].z);
            glScalef(moonInfo[i].radius, moonInfo[i].radius, moonInfo[i].radius);
            moons[i].draw();
        glPopMatrix();
    }
    
    // Draw rings
    glPushMatrix();
        glTranslatef(ringInfo.x, 0.f, ringInfo.z);
        glScalef(ringInfo.radius, ringInfo.radius, ringInfo.radius);
        ring.draw();
    glPopMatrix();
    
	// send the current image to the screen - any drawing after here will not display
	glutSwapBuffers();
}
开发者ID:streibeb,项目名称:cs409,代码行数:48,代码来源:main.cpp

示例2: display

void display()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	// clear the screen - any drawing before here will not display

	glLoadIdentity();
	// set up the camera here
    camera.setCamera();

    // Draw the world
    world.drawSkybox(camera);
    world.drawSaturn();
    world.drawMoons();
    world.drawRings(camera);
    
	// send the current image to the screen - any drawing after here will not display
	glutSwapBuffers();
}
开发者ID:streibeb,项目名称:cs409,代码行数:18,代码来源:main.cpp

示例3: display

void display()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	// clear the screen - any drawing before here will not display

	glLoadIdentity();
	// set up the camera here
    camera.setCamera();

	// camera is set up - any drawing before here will display incorrectly

	drawOrientationCube();
	glColor3f(0.75f, 0.75f, 0.75f);
	glutSolidSphere(0.5, 20, 15);

	// send the current image to the screen - any drawing after here will not display
	glutSwapBuffers();
}
开发者ID:streibeb,项目名称:cs409,代码行数:18,代码来源:main6.cpp


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