Page 1 of 1

Problem using .irr Scenes

Posted: Thu Aug 31, 2006 2:45 pm
by sudi
Ok somehow the SceneLoading isn't working on my system...
When i use the following code i prints out in the console window that it loaded all the meshes and textures correctly but nothing is drawn on the screen and the fps camera doesn't work either(means the mouse doesn't stay in the middle of the screen)
can anyone help me?

edit: Only scenes made with irrEdit 0.4 don'T work the shipped exampel does work

Code: Select all

int main(int argc, char *argv[])
{

    IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(640,480), 32, false, true, false, NULL);

    video::IVideoDriver* driver = device->getVideoDriver();
    scene::ISceneManager* smgr = device->getSceneManager();
    gui::IGUIEnvironment* gui = device->getGUIEnvironment();

    device->setWindowCaption(L"ShootIrr");

    smgr->loadScene("data/levels/mytest.irr", 0);
    smgr->addCameraSceneNodeFPS();

    // draw everything
    while(device->run() && driver)
    {
           driver->beginScene(true, true, video::SColor(255,0,0,255));
           smgr->drawAll();
           gui->drawAll();
           driver->endScene();
    }

    // delete device
    device->drop();

    system("PAUSE");
    return EXIT_SUCCESS;
}

Posted: Thu Aug 31, 2006 4:13 pm
by andrei25ni
I had that problem too. It because of the new irr file.
Open the file with a text editor and replace the attributes tree with :

Code: Select all

	<attributes>
		<string name="Name" value="root" />
		<int name="Id" value="-1" />
		<vector3d name="Position" value="0.000000, 0.000000, 0.000000" />
		<vector3d name="Rotation" value="0.000000, 0.000000, 0.000000" />
		<vector3d name="Scale" value="1.000000, 1.000000, 1.000000" />
		<bool name="Visible" value="true" />
		<bool name="AutomaticCulling" value="true" />
		<bool name="DebugDataVisible" value="false" />
		<bool name="IsDebugObject" value="false" />
		<colorf name="AmbientLight" value="0.000000, 0.000000, 0.000000,
0.000000" />
	</attributes>
Hope it works :wink:

Posted: Thu Aug 31, 2006 4:19 pm
by sudi
Jepp it works perfectly....but why is it like that?????

Posted: Fri Sep 01, 2006 9:36 am
by andrei25ni
Guess that Niko forget to generate that piece of code in the new version. :roll:

Posted: Sat Sep 02, 2006 6:15 am
by niko
Ah, sorry, too bad. :) I changed the loading part a bit, it works with the version in the SVN. I'm going to change the saving of .irr files a bit again in irrEdit 0.5 to make it work with irrlicht 1.1 again.