Hello Josef,
Thanks for that ......it worked except for the some warnings as follows:
WARNING: SwitchMaterial::getState: choice index out of range!
WARNING: SwitchMaterial::isMultiPass: choice index out of range!
WARNING: SwitchMaterial::isTransparent: choice index out of range!
WARNING: SwitchMaterial::isTransparent: choice index out of range!
WARNING: SwitchMaterial::isMultiPass: choice index out of range!
The above warnings repeat with the initial loading of the object until i
press the keyboard event
to set different material and after that keyboard event these warnings does
not show up.
Is there any way to suppress these warnings:
(The code snippet is not so long ,so i hope i can paste that below)
NodePtr utah_teapot = SceneFileHandler::the().read("teapot.obj");
/*
Check if the data loading
operation was ok or not
*/
if(utah_teapot == NullFC)
{
cout << "Loading the specified file was not possible." << endl;
return NullFC;
}
//set a string name for that node
//we shall use that string to search
setName(utah_teapot,"UTAH_TEAPOT");
GeometryPtr geoUtah = GeometryPtr::dcast(utah_teapot->getCore());
/*
Check if the dyamic-casting was successful
*/
if(!geoUtah)
{
cout << "The dynamaic casting was not successful" << endl;
return NullFC;
}
//instantiate the switch material
switchMaterialCore = SwitchMaterial::create();
beginEditCP(switchMaterialCore, SwitchMaterial::MaterialsFieldMask |
SwitchMaterial::ChoiceFieldMask);
switchMaterialCore->addMaterial(createToonScene());
switchMaterialCore->addMaterial(createPhongScene());
switchMaterialCore->setChoice(Switch::NONE);
endEditCP(switchMaterialCore, SwitchMaterial::MaterialsFieldMask |
SwitchMaterial::ChoiceFieldMask);
beginEditCP(geoUtah, Geometry::MaterialFieldMask);
geoUtah->setMaterial(switchMaterialCore);
endEditCP(geoUtah, Geometry::MaterialFieldMask);
return utah_teapot;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users