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


C++ StateSet::setAttributeAndModes方法代码示例

本文整理汇总了C++中osg::StateSet::setAttributeAndModes方法的典型用法代码示例。如果您正苦于以下问题:C++ StateSet::setAttributeAndModes方法的具体用法?C++ StateSet::setAttributeAndModes怎么用?C++ StateSet::setAttributeAndModes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osg::StateSet的用法示例。


在下文中一共展示了StateSet::setAttributeAndModes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setBlending

void myModel::setBlending()
{
    _blendFunc = new osg::BlendFunc;
    _stateset = _model->getOrCreateStateSet();
    _blendFunc->setFunction(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    _stateset->setAttributeAndModes( _blendFunc );
}
开发者ID:wow2006,项目名称:OSG_Book,代码行数:7,代码来源:myProject03.cpp

示例2: Configurar_Material

void Configurar_Material()
{
		// version which sets the color of the wireframe.
	    material->setColorMode(osg::Material::OFF); // switch glColor usage off
	    // turn all lighting off
		material->setShininess(osg::Material::FRONT_AND_BACK,10.0f);
	    material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,1.0f,0.0f,1.0f));
	    material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,1.0f,0.0f,1.0f));
	    material->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,1.0f,0.0f,1.0f));
	    // except emission... in which we set the color we desire
	    material->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0,0.0f,0.0f,1.0f));
	    stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
	    stateset->setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
		Torreta->setStateSet(stateset);
}
开发者ID:gayoxo,项目名称:ProyectoIGr,代码行数:15,代码来源:Torreta.cpp

示例3: createShaders

	void createShaders(osg::StateSet& ss)
	{
		osg::ref_ptr<osg::Shader> verShader=
			new osg::Shader(osg::Shader::VERTEX,vertSource);
		osg::ref_ptr<osg::Shader> fragShader=
			new osg::Shader(osg::Shader::FRAGMENT,fragSource);

		osg::ref_ptr<osg::Program> program=new osg::Program;
		program->addShader(verShader.get());
		program->addShader(fragShader.get());

		osg::ref_ptr<osg::Uniform> mainColor=
			new osg::Uniform("mainColor",osg::Vec4(1,0.5,0.5,1));
		mainColor->setUpdateCallback(new ColorCallback);

		ss.addUniform(mainColor.get());
		ss.setAttributeAndModes(program.get());
	}
开发者ID:gisair,项目名称:EAView,代码行数:18,代码来源:test.cpp

示例4: nave

	torreta(int x, int y, int z,int tamaño)
	{
	Torreta = new osg::Group();
		material = new osg::Material;
		stateset =new osg::StateSet;
	//Configurar_Material();
	boton=y;
	left=x;
	//top=(8*tamaño)+z;
	//right=(11*tamaño);
	int	tamaño_cubo_grade=tamaño*5;
	nave* cubomio=new nave (x,y,z,tamaño_cubo_grade);
	int puntopunta=tamaño_cubo_grade;
	puntopunta=puntopunta/2;
	puntopunta=puntopunta-(tamaño/2);
	nave* cubomio2=new nave(x+puntopunta,y,tamaño_cubo_grade+z,tamaño);
	Torreta->addChild(cubomio->getNave());
	Torreta->addChild(cubomio2->getNave());
	top=tamaño_cubo_grade+tamaño+y;
	right=tamaño_cubo_grade+x;
	yDisparo=top;
	xDisparo=x+puntopunta;
		 stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
	};
开发者ID:gayoxo,项目名称:ProyectoIGr,代码行数:24,代码来源:Torreta.cpp


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