Exemplo n.º 1
0
	void ObjectClue::draw() {

		if (!_caught) {

			if (isDebug()) {

				float* color = getBoundingSphere(0)->getColor();
				glPushMatrix();

					glDisable(GL_LIGHTING);

					glColor3f(color[0], color[1], color[2]);
					glTranslated(getBoundingSphere(0)->getPosition()[0], getBoundingSphere(0)->getPosition()[1], getBoundingSphere(0)->getPosition()[2]);
					glutWireSphere(getBoundingSphere(0)->getRadius(), 20, 20);

					glEnable(GL_LIGHTING);

				glPopMatrix();
			}

			TextureManager* tm = dynamic_cast<TextureManager*>( cg::Registry::instance()->get("TextureManager"));
			MaterialManager* mm = dynamic_cast<MaterialManager*>( cg::Registry::instance()->get("MaterialManager"));
			GLuint txClue = tm->get("clue")->getTextureDL();
			
			glPushMatrix();
				
				glEnable(GL_TEXTURE_2D);
				//mm->get("emerald")->apply();
				glTranslated(_position[0], _position[1], _position[2] + CLUE_SIZE / 2);
				glScalef(CLUE_SIZE, CLUE_SIZE, CLUE_SIZE);
				unitCube(txClue);
				glDisable(GL_TEXTURE_2D);
			glPopMatrix();
		}
	}
Exemplo n.º 2
0
void Projection::render(QGraphicsScene *scene) {
    QMatrix4x4 matrix = transformMatrix()
            * scaleMatrix(scene->width(), -scene->height(), 1)
            * shiftMatrix(0, scene->height(), 0);

    scene->clear();

    renderSegments(scene, unitCube(), matrix);
    renderSegments(scene, axes(), matrix);
}