本文整理汇总了C++中Appearance::getSWrap方法的典型用法代码示例。如果您正苦于以下问题:C++ Appearance::getSWrap方法的具体用法?C++ Appearance::getSWrap怎么用?C++ Appearance::getSWrap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Appearance
的用法示例。
在下文中一共展示了Appearance::getSWrap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processAppearances
void XMLScene::processAppearances(TiXmlElement* appearancesElement)
{
TiXmlElement* element= appearancesElement->FirstChildElement("appearance");
float ambient[4],diffuse[4],specular[4],emissive[4],shininess,sWrap,tWrap;
string textureRef,id;
Appearance* appearance;
while(element!=NULL)
{
id=element->Attribute("id");
read1Float("shininess",element,shininess);
if(element->Attribute("textureref")!=NULL)
textureRef=element->Attribute("textureref");
else textureRef="";
TiXmlElement* component = element ->FirstChildElement();
while(component != NULL){
if(component->Attribute("type")=="ambient"){
read4Float("value", element, ambient[0], ambient[1], ambient[2],
ambient[3]);}
if(component->Attribute("type")=="diffuse"){
read4Float("value", element, diffuse[0], diffuse[1], diffuse[2],
diffuse[3]);}
if(component->Attribute("type")=="specular"){
read4Float("value", element, specular[0], specular[1], specular[2],
specular[3]);
}
component=component->NextSiblingElement();
}
if(textureRef!=""){
Texture* temp = Textures[textureRef];
appearance = new Appearance(ambient,diffuse,specular,emissive,shininess,temp->getSWrap(),temp->getTWrap(),textureRef);
appearance->setTextureWrap(appearance->getSWrap(),appearance->getTWrap());
appearance->setTexture(sceneTextures[textureRef]);
}
else
appearance = new Appearance(ambient,diffuse,specular,emissive,shininess,1,1,textureRef);
appearances[id]=appearance;
element=element->NextSiblingElement("appearance");
}
}