backNode->draw(painter); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); GLfloat color[4] = { 1, 1, 1, 0.2}; glColor4fv(color); frontNode->draw(painter); glDisable(GL_BLEND);
program->setAttributeArray (PROGRAM_VERTEX_ATTRIBUTE, vertices.constData()); program->setAttributeArray (PROGRAM_TEXCOORD_ATTRIBUTE, texCoords.constData());
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); GLfloat color[4] = { 1, 1, 1, 0.23 }; glColor4fv(color);
} else if (keyword == "d") { // "Dissolve factor" of the material, which is its opacity. if (material) { qreal alpha = objReadFloat(line, &posn); QColor ambient = material->ambientColor(); QColor diffuse = material->diffuseColor(); ambient.setAlphaF(alpha); diffuse.setAlphaF(alpha); material->setAmbientColor(ambient); material->setDiffuseColor(diffuse); }