void App::drawFrame() { mat4 projection = perspectiveMatrixX(1.5f, width, height, 0.001f, 1.0f); mat4 mvRotate = rotateXY(-wx, -wy); mat4 modelview = mvRotate * translate(-camPos); glMatrixMode(GL_PROJECTION); glLoadTransposeMatrixf(projection); glMatrixMode(GL_MODELVIEW); glLoadTransposeMatrixf(modelview); // Determine the shader selections radialSelect = 0; if(doRadialEnvMap->isChecked()) { radialSelect = 1; } constMipSelect = 0; if(constantMipLevel->isChecked()) { constMipSelect = 1; } // Clear only depth renderer->clear(false, true, false); // Draw the background environment drawEnvironment(projection * mvRotate); // Draw the object drawObject(); }
void ofxPBR::renderScene() { if (enableDrawEnvironment) { drawEnvironment(); } scene(); }
void Game::draw() const { drawEnvironment(this); drawGameField(false); sgoBall.drawGameBall(); switch (mGameState) { case STATE_MENU: break; case STATE_COUNTDOWN: glPushMatrix(); { const Vector3 x = rotateVector(Vector3(1.0f, 0.0f, 0.0f)); const Vector3 y = rotateVector(Vector3(0.0f, 1.0f, 0.0f)); const Vector3 z = rotateVector(Vector3(0.0f, 0.0f, 1.0f)); const Vector3& pos = sgoBall.pos(); Matrix m; m[0][0] = x.x; m[0][1] = x.y; m[0][2] = x.z; m[0][3] = 0.0f; m[1][0] = y.x; m[1][1] = y.y; m[1][2] = y.z; m[1][3] = 0.0f; m[2][0] = z.x; m[2][1] = z.y; m[2][2] = z.z; m[2][3] = 0.0f; m[3][0] = pos.x; m[3][1] = pos.y; m[3][2] = pos.z; m[3][3] = 1.0f; glMultMatrixf((GLfloat*) m); drawRingStrip(100, mCounter / COUNTDOWN_TIME, mTextureRing); } glPopMatrix(); break; default: break; } }
void Simulation::simStep(double dt, sf::RenderWindow *window) { window->clear(sf::Color(255, 255, 255)); window->setView(coordinateSystem); drawEnvironment(window); mySolver.step(dt); for (int i = 0; i < mySolver.objects.size(); i ++) { mySolver.objects[i]->draw(window); } }
void display() { glClear(GL_COLOR_BUFFER_BIT); if (objectFlag) drawEnvironment(); drawNeutrons(tailFlag); if (explosionFlag) drawExplosions(); wmDrawWindows(ww,wh); // measure, limit, and display framerate frameMark(FRAME_LIMIT); //if (frameFlag) frameDraw(GLUT_BITMAP_HELVETICA_10, 1.0, 1.0, 1.0, 0.05, 0.95); glutSwapBuffers(); }
void Exercise13::render() { glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); drawEnvironment(); glBindTexture(GL_TEXTURE_2D, m_textureID); glActiveTexture(GL_TEXTURE0); QMatrix4x4 transform = applyBallTransformation(m_frame) * m_sphereScale; m_program1->bind(); m_program1->setUniformValue("lightsource", QVector3D(0.0, 10.0, 0.0)); m_program1->setUniformValue("viewprojection", camera()->viewProjection()); m_program1->setUniformValue("transform", transform); m_program1->setUniformValue("normalMatrix", (camera()->view() * transform).normalMatrix()); m_program1->setUniformValue("diffuse", 0); m_sphere.draw(*this); }
void Game::drawBallReflection() const { drawEnvironment(this); drawGameField(true); }
void Choose::draw() const { drawEnvironment(this); drawEditorField(); }