当前位置: 首页>>代码示例>>C++>>正文


C++ setMaterial函数代码示例

本文整理汇总了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);
    }
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:10,代码来源:simplematerial.cpp

示例2: setActive

bool GuiMaterialCtrl::onWake()
{
   if ( !Parent::onWake() )
      return false;

   setActive( true );
   setMaterial( mMaterialName );

   return true;
}
开发者ID:fr1tz,项目名称:alux3d,代码行数:10,代码来源:guiMaterialCtrl.cpp

示例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);
}
开发者ID:llovett,项目名称:ferriswheel,代码行数:10,代码来源:ferriswheel.cpp

示例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);
}
开发者ID:jleben,项目名称:quickcollider,代码行数:10,代码来源:oscilloscope.cpp

示例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();
}
开发者ID:pombredanne,项目名称:anacrolix,代码行数:42,代码来源:robot.c

示例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();
}
开发者ID:ChangerR,项目名称:dream,代码行数:12,代码来源:CNullDriver.cpp

示例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);
			}
		}
	}
}
开发者ID:bw2012,项目名称:UnrealSandboxTerrain,代码行数:11,代码来源:VoxelData.cpp

示例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
}
开发者ID:hindaka,项目名称:TUGAS-KELOMPOK-3D,代码行数:11,代码来源:main.cpp

示例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);
}
开发者ID:nxgraphics,项目名称:NxGraphics,代码行数:11,代码来源:NxRenderablesLines.cpp

示例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);
}
开发者ID:cneben,项目名称:QuickQanava,代码行数:12,代码来源:qglSGPolyLineNode.cpp

示例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);
 }
开发者ID:onze,项目名称:Steel,代码行数:12,代码来源:DynamicLines.cpp

示例12: display

void
display(void)
{
  if (useSpecularTexture && needsLightUpdate) {
    setMaterial(MAT_GEN_SPECULAR_TEXTURE);
    needsLightUpdate = GL_FALSE;
  }
  redraw();
  glFlush();
  glutSwapBuffers();
  checkErrors();
}
开发者ID:hiteshsathawane,项目名称:Cube-Rotation,代码行数:12,代码来源:envphong.c

示例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);
}
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:12,代码来源:qsgninepatchnode.cpp

示例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();
}
开发者ID:lemourin,项目名称:GameEngine,代码行数:12,代码来源:AddChain.cpp

示例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 );
}
开发者ID:CS-SI,项目名称:QGIS,代码行数:12,代码来源:qgsphongmaterialwidget.cpp


注:本文中的setMaterial函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。