Problem loading .dmf
-
- Posts: 30
- Joined: Wed Sep 10, 2008 9:04 pm
Problem loading .dmf
I've made a really simple level in DeleD using 3ds meshes. I tried loading into irrlicht but i only see white, no errors just white.
I've created a "media" folder where i store the 3ds and their textures, but i've also noticed that to give a mesh a texture you made, you've to copy that texture in the DeleD texture directory.
Could it be a path problem? Because i've both the textures and the meshes in my media folder, which i use to load everything with irrlicht.
I've created a "media" folder where i store the 3ds and their textures, but i've also noticed that to give a mesh a texture you made, you've to copy that texture in the DeleD texture directory.
Could it be a path problem? Because i've both the textures and the meshes in my media folder, which i use to load everything with irrlicht.
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm
-
- Posts: 30
- Joined: Wed Sep 10, 2008 9:04 pm
Nope, it wasn't that.
Apparently, the scene is empty. It loads everything without problem, but the things i put in the scene in DeleD don't appear in the program.
Here is the code:
We were using .irr before, but since irredit sucks; we decided to use .dmf; perhaps they use different loading procedures for scenes and that is the problem.
Another problem might be the textures path, in the .irr scene we were using a media folder, so the path was "media/textures/blah.jpg", but with DeleD we can't create a folder like that, in fact i can't even delete the system folder from the my scene material editor.
We're using Irrlicht 1.5
Apparently, the scene is empty. It loads everything without problem, but the things i put in the scene in DeleD don't appear in the program.
Here is the code:
bool
draw::LEVEL::load(char * name,physics::INIT_PHYSICS *p_newt_manager, ISceneManager* pScene){
if(pScene->loadScene(name)){
//Physics
core::array<irr::scene::ISceneNode*> listProps;
pScene->getSceneNodesFromType(ESNT_MESH,listProps);
for(unsigned int i =0; i<listProps.size(); i++){
irr::newton::SBodyFromNode props_data;
props_data.Type=newton::E_BODY_TYPE::EBT_TREE;
props_data.Node= listProps;
scene::IMeshSceneNode* msn = (scene::IMeshSceneNode*)listProps;
props_data.Mesh=msn->getMesh();
props_data.BodyOffsetFromNode.setScale(core::vector3df(listProps->getScale()));
irr::newton::IBody *temp = p_newt_manager->getPhysicsWorld()->createBody(props_data);
char* s1 = (char*)listProps->getName();
char* s2 = "floor";
if(strcmp(s1,s2))
temp->setMaterial(p_newt_manager->getMaterial(MATERIALS_ID::LEVEL));
}
listProps.clear();
//add Camera
cam = pScene->addCameraSceneNode(0,core::vector3df(0,CAMERA_HEIGHT,0),core::vector3df(0,0,0.9f),-1);
cam->setAutomaticCulling(EAC_FRUSTUM_BOX);
cam->setFOV(core::degToRad(30.0f));
//cam->setAspectRatio(4.0f/3.0f);
cam->setFarValue(CAMERA_HEIGHT+1);
cam->setNearValue(50);
//Get Floor mesh
scene::IMeshSceneNode* msn = (scene::IMeshSceneNode*)pScene->getSceneNodeFromName("floor");
if(msn)
terrainSelector = pScene->createOctTreeTriangleSelector(msn->getMesh(),pScene->getSceneNodeFromName("floor"));
return true;
}
return false;
}
We were using .irr before, but since irredit sucks; we decided to use .dmf; perhaps they use different loading procedures for scenes and that is the problem.
Another problem might be the textures path, in the .irr scene we were using a media folder, so the path was "media/textures/blah.jpg", but with DeleD we can't create a folder like that, in fact i can't even delete the system folder from the my scene material editor.
We're using Irrlicht 1.5
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
For the path you may try
You cannot load a scene from dmf, only meshes. So use the getMesh code from the examples. This will put the whole scene of your dmf file into one object, though. Jus be aware of this fact.
Code: Select all
SceneManager->getStringParameters()->setAttribute(scene::DMF_TEXTURE_PATH, "path/to/your/textures");
-
- Posts: 30
- Joined: Wed Sep 10, 2008 9:04 pm
If i want to load scenes like the .irr we were using, what level editor would you recommend me?
Irredit sucks, it's crazy to use it if you can't ctrl+z properly. Deled was really cool to use, but since we want to put lights and stuff, i'd prefer to use a type of file that loads complete scenes and not only the meshes
Edit: is the .dxs the same as the .dmf or it does save the whole scene?
Irredit sucks, it's crazy to use it if you can't ctrl+z properly. Deled was really cool to use, but since we want to put lights and stuff, i'd prefer to use a type of file that loads complete scenes and not only the meshes
Edit: is the .dxs the same as the .dmf or it does save the whole scene?
-
- Posts: 30
- Joined: Wed Sep 10, 2008 9:04 pm
-
- Posts: 30
- Joined: Wed Sep 10, 2008 9:04 pm
-
- Posts: 30
- Joined: Wed Sep 10, 2008 9:04 pm
The code is some posts above.
I've uploaded the scene file with the objects and the textures:
http://www.sendspace.com/file/rxu7g4
One object is the lantern, the other one is the floor. The black texture is for the floor and the rust one for the stone lantern
I've uploaded the scene file with the objects and the textures:
http://www.sendspace.com/file/rxu7g4
One object is the lantern, the other one is the floor. The black texture is for the floor and the rust one for the stone lantern
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
The problem is that you use absolute texture paths. I've fixed the DMF loader to try even more paths in SVN/trunk. As a workaround in case you don't want to use that Irrlicht version you can simply edit the dmf files and remove the absolute path of the textures (i.e. everything up to media/textures...)