本文整理汇总了C++中setMaterial函数的典型用法代码示例。如果您正苦于以下问题:C++ setMaterial函数的具体用法?C++ setMaterial怎么用?C++ setMaterial使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setMaterial函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ColorNode
ColorNode()
: m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
{
setGeometry(&m_geometry);
QSGSimpleMaterial<State> *material = Shader::createMaterial();
material->setFlag(QSGMaterial::Blending);
setMaterial(material);
setFlag(OwnsMaterial);
}
示例2: setActive
bool GuiMaterialCtrl::onWake()
{
if ( !Parent::onWake() )
return false;
setActive( true );
setMaterial( mMaterialName );
return true;
}
示例3: bench
void bench( float shrink ) {
setMaterial( &benchMats );
glPushMatrix();
glTranslatef(0, 0, -shrink*BENCH_DEPTH);
box(shrink*BENCH_WIDTH, shrink*BENCH_HEIGHT, shrink*BENCH_DEPTH);
glPopMatrix();
box(shrink*BENCH_WIDTH, shrink*BENCH_HEIGHT/2, shrink*BENCH_DEPTH);
}
示例4: m_geometry
PlotNode2D::PlotNode2D():
m_geometry(QSGGeometry::defaultAttributes_Point2D(), 0)
{
m_geometry.setDrawingMode(GL_LINE_STRIP);
m_geometry.setLineWidth(1);
//m_geometry.setVertexDataPattern(QSGGeometry::DynamicPattern);
setGeometry(&m_geometry);
setMaterial(&m_material);
}
示例5: drawHandle
void drawHandle ()
{
int i;
glPushMatrix();
glTranslatef(0, 0, -0.5);
setMaterial(plasticDiffuse, plasticSpecular, plasticShininess);
gluCylinder(qobj, 0.1, 0.1, 1.0, 12, 1);
glTranslatef(0.0, 0.0, 1.0);
if (robotMode == BADASS) {
setMaterial(beaterDiffuse, beaterSpecular, beaterShininess);
//glColor3f(0.8, 0.8, 0.8);
gluCylinder(qobj, 0.02, 0.02, 1.0, 12, 1);
for (i = 0; i < 4; i++) {
glPushMatrix();
glTranslatef(0, 0, 0.5);
glRotatef(90.0*i + beaterAngle, 0.0, 0.0, 1.0);
/*
glBegin(GL_LINE_STRIP);
glVertex3f(0.0, 0.0, 0.5);
glVertex3f(0.1, 0.0, 0.6);
glVertex3f(0.1, 0.0, 0.9);
glVertex3f(0.0, 0.0, 1.0);
glEnd();
*/
glPushMatrix();
glTranslatef(0.1, 0.0, 0.1);
gluCylinder(qobj, 0.01, 0.01, 0.3, 12, 1);
glPopMatrix();
glPushMatrix();
glRotatef(45, 0, 1, 0);
gluCylinder(qobj, 0.01, 0.01, 0.1*sqrtf(2), 12, 1);
glPopMatrix();
glPushMatrix();
glTranslatef(0.1, 0, 0.4);
glRotatef(-45, 0, 1, 0);
gluCylinder(qobj, 0.01, 0.01, 0.1*sqrtf(2), 12, 1);
glPopMatrix();
glPopMatrix();
}
}
glPopMatrix();
}
示例6: setMaterial
//! deletes all textures
void CNullDriver::deleteAllTextures()
{
// we need to remove previously set textures which might otherwise be kept in the
// last set material member. Could be optimized to reduce state changes.
setMaterial(SMaterial());
for (u32 i=0; i<Textures.size(); ++i)
Textures[i].Surface->releaseRef();
Textures.clear();
}
示例7: setMaterial
FORCEINLINE void TVoxelData::initializeMaterial() {
const int s = voxel_num * voxel_num * voxel_num;
material_data = new unsigned short[s];
for (auto x = 0; x < voxel_num; x++) {
for (auto y = 0; y < voxel_num; y++) {
for (auto z = 0; z < voxel_num; z++) {
setMaterial(x, y, z, base_fill_mat);
}
}
}
}
示例8: displayObject
void displayObject()
{
setMaterial();
setLighting();
setViewport();
setCamera();
//startDrawing
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
sate();//memanggil fungsi menggambar objek sate
glFlush();//mengirim semua objek untuk dirender
}
示例9: mUseVertexColour
NxLine::NxLine( OperationType opType, bool UseVertexColour ) : mUseVertexColour(UseVertexColour)
{
initialize(opType,false);
setMaterial("BaseWhiteNoLighting");
mDirty = true;
setRenderQueueGroup( RENDER_QUEUE_OVERLAY - 1);
// animation spline
mAnimSpline = new SimpleSpline();
mAnimSpline->setAutoCalculate(true);
}
示例10: setFlag
SGPolyLineNode::SGPolyLineNode( const QVector<QPointF>& points ) noexcept :
QSGGeometryNode{}
{
setFlag( QSGNode::OwnedByParent, true );
try {
_material = new qgl::SGPolyLineAAMaterial{};
setFlag( QSGNode::OwnsMaterial );
setMaterial( _material );
markDirty( QSGNode::DirtyMaterial );
} catch (...) { }
createGeometry(points);
}
示例11: setMaterial
void DynamicLines::setColor(Ogre::ColourValue color)
{
// color-coded id
unsigned int matIndex = ((unsigned int)(color.r) << 24) +
((unsigned int)(color.g) << 16) +
((unsigned int)(color.b) << 8) +
((unsigned int)(color.a));
Ogre::String matName = "DL" + Ogre::StringConverter::toString(matIndex);
Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().createOrRetrieve(matName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME).first.staticCast<Ogre::Material>();
materialPtr->setAmbient(color);
setMaterial(matName);
}
示例12: display
void
display(void)
{
if (useSpecularTexture && needsLightUpdate) {
setMaterial(MAT_GEN_SPECULAR_TEXTURE);
needsLightUpdate = GL_FALSE;
}
redraw();
glFlush();
glutSwapBuffers();
checkErrors();
}
示例13: m_geometry
QSGNinePatchNode::QSGNinePatchNode()
: m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 0)
, m_horizontalTileMode(QSGBorderImage::Stretch)
, m_verticalTileMode(QSGBorderImage::Stretch)
, m_dirtyGeometry(false)
, m_mirror(false)
{
setOpaqueMaterial(&m_material);
setMaterial(&m_materialO);
setGeometry(&m_geometry);
m_geometry.setDrawingMode(GL_TRIANGLES);
}
示例14: m_geometry
AddChain::Node::Node(std::vector<QPointF> pts)
: m_geometry({{2, GL_FLOAT}}, pts.size() + 1, sizeof(QVector2D)) {
setMaterial(&m_material);
setGeometry(&m_geometry);
m_geometry.setDrawingMode(GL_LINE_STRIP);
QVector2D* array = m_geometry.vertexData<QVector2D>();
for (size_t i = 0; i < pts.size(); i++)
array[i] = QVector2D(pts[i].x(), pts[i].y());
array[pts.size()] = array[pts.size() - 1];
m_geometry.updateVertexData();
}
示例15: QWidget
QgsPhongMaterialWidget::QgsPhongMaterialWidget( QWidget *parent )
: QWidget( parent )
{
setupUi( this );
setMaterial( QgsPhongMaterialSettings() );
connect( btnDiffuse, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
connect( btnAmbient, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
connect( btnSpecular, &QgsColorButton::colorChanged, this, &QgsPhongMaterialWidget::changed );
connect( spinShininess, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsPhongMaterialWidget::changed );
}