本文整理汇总了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();
}
示例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();
}
示例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();
}