Having problems loading a .nxs mesh.

R0nan07

25-10-2011 15:24:14

I'm trying to load the mesh with this code;
NxOgre::Mesh* cone = NxOgre::MeshManager::getSingleton()->load("C:\cone.nxs", "cone");

When it hits that line it throws the following exception:
if (protocol == 0)
{
StringStream error_message;
error_message << "Could not open resource '" << path.getString() << "\n"
<< "Reason: Protocol '" << path.getProtocol() << "' could not be found.";
NxOgre_ThrowException(IOException, error_message.str(), Classes::_MeshSerialiser);
return 0;
}


I know this has probably been asked many times before but I can't seem to find the answer.
Thanks

saejox

25-10-2011 19:58:38

afaik, load() uses resourse system. you cant load directly from file.
define your resources in resources.cfg then call it like this

string nxs = "ogre://General/" + objectname + ".nxs";

saejox

25-10-2011 20:00:44

afaik, load() uses ogre resource system. you cant load resources directly from file.
define your resources in resources.cfg then call it like this


string nxs = "ogre://General/" + objectname + ".nxs";