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


C++ Appearance::setEmissive方法代码示例

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


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

示例1: pontoAux


//.........这里部分代码省略.........
	}

	//--------- Appearances Parsing -----------
	appearancesElement = yafElement->FirstChildElement( "appearances" );

	if (appearancesElement == NULL)
		printf("Appearances block not found!\n");
	else
	{
		printf("Processing Appearances...\n");
		TiXmlElement* appearanceElement = appearancesElement->FirstChildElement("appearance");
		while (appearanceElement)
		{

			Appearance* ap = new Appearance();
			string id, textureref;
			
			string emissiveS, ambientS, diffuseS, specularS;
			float shininess, texlength_s, texlength_t;

			if (appearanceElement->QueryFloatAttribute("shininess",&shininess)==TIXML_SUCCESS &&
				appearanceElement->Attribute("id") != NULL &&
				appearanceElement->Attribute("emissive") != NULL &&
				appearanceElement->Attribute("ambient") != NULL &&
				appearanceElement->Attribute("diffuse") != NULL &&
				appearanceElement->Attribute("specular") != NULL
				){
					id = appearanceElement->Attribute("id");
					ap->setIdS(id);

					emissiveS = appearanceElement->Attribute("emissive");
					float Aemissive[4];
					sscanf_s(emissiveS.c_str(),"%f %f %f %f", &Aemissive[0], &Aemissive[1], &Aemissive[2], &Aemissive[3]);
					ap->setEmissive(Aemissive);

					ambientS = appearanceElement->Attribute("ambient");
					float Aambient[4];
					sscanf_s(ambientS.c_str(),"%f %f %f %f", &Aambient[0], &Aambient[1], &Aambient[2], &Aambient[3]);
					ap->setAmbient(Aambient);

					diffuseS = appearanceElement->Attribute("diffuse");
					float Adiffuse[4];
					sscanf_s(diffuseS.c_str(),"%f %f %f %f", &Adiffuse[0], &Adiffuse[1], &Adiffuse[2], &Adiffuse[3]);
					ap->setDiffuse(Adiffuse);

					specularS = appearanceElement->Attribute("specular");
					float Aspecular[4];
					sscanf_s(specularS.c_str(),"%f %f %f %f", &Aspecular[0], &Aspecular[1], &Aspecular[2], &Aspecular[3]);
					ap->setSpecular(Aspecular);


					if(appearanceElement->Attribute("textureref") != NULL)
					{
						if(appearanceElement->QueryFloatAttribute("texlength_s",&texlength_s)==TIXML_SUCCESS &&
							appearanceElement->QueryFloatAttribute("texlength_t",&texlength_t)==TIXML_SUCCESS)
						{

							textureref = appearanceElement->Attribute("textureref");
							ap->setTextureReference(textureref);
							//ap->setTexture(textureref);

							ap->setTextureWrap(texlength_s,texlength_t);

							ap->setShininess(shininess);

							int itTexturesComp = 0;
开发者ID:,项目名称:,代码行数:67,代码来源:


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