CAN ANYONE HELP?? Meshs crashing program

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

CAN ANYONE HELP?? Meshs crashing program

Post by steveybop »

I have been having some problems lately with my Irrlicht/Newton program, it has been crashing and freezing during the drawAll() method. i traced the problem back to the getMesh() method in my program. to test it, I loaded the sydney model from the tutorials and it loaded fine, its then i realised that its the model i made with wings 3d that is crashing my program!

how can this be? its a really basic rectangle of .3ds format, yet when i try to draw it the program crashes.
if i 'save as' Wings makes the model i made to be .wings format, but if i 'export' as .3ds it output the model in .3ds format (or so i thought)
none of the models i made seem to work, if i try to load them they crash the program and windows!

I started a thread a few weeks ago asking which modeller was easy to use as i just needed to make a few basic primitves like a large floor (just a big flat rectangle). unfortunately the thread got blocked as the moderator said the tools list had all the modeller information needed. Granted the tools list has a large number of links but when you dont know what you are looking for it is too much at once. what i wanted was peoples opinions based on their experience.
So i ask, once again, can anyone tell me a SIMPLE modeller, which can output basic primatives in a format usable by Irlicht. Or can somebody tell me what im doing wrong with Wings 3D?????
Sorry for the rant but this has brought my project to a standstill for about 2 weeks
Please help!!!
Last edited by steveybop on Wed Apr 06, 2005 11:06 am, edited 1 time in total.
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
Guest

Post by Guest »

You might wanna try to export to .obj. I haven't tried it myself but it might help.
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

i realise this is a bit cheeky, but is there any chance somebody out there could make me a mesh. all i need is a large flat floor on which to have my objects, any format just once its supported by Irrlicht.
Should take about 10 seconds for anyone who has a clue about these tools, this is holding up my whole project, which is really frustrating as it is a pretty small part with nothing to do with either irrlicht or newton.
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
Tyrus
Posts: 4
Joined: Sat Mar 19, 2005 7:54 pm
Location: Germany

Post by Tyrus »

Hi,

I would make the objects. It was a big plane with some primitive objects right?

Shouldn't take too long to make them :wink:
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

Hey Tyrus,
Thanks for replying, all i need is a flat rectangular plane, like a large floor, which i can use as the ground object. I have been trying to load a .3ds floor i made with Wings3D, using these methods:

Code: Select all

        floor->mesh = sceneman->getMesh("media/floor.3ds");
	floor->node = sceneman->addAnimatedMeshSceneNode(floor->mesh);
	floor->node->setMaterialTexture(0,          driver->getTexture("media/floor_rock01.jpg"));
So if they could be in any format that would be compatible with these methods.
Cheers for the help.
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
Tyrus
Posts: 4
Joined: Sat Mar 19, 2005 7:54 pm
Location: Germany

Post by Tyrus »

I made 2 files now. 1 with a plane and some primitives and one with the plane.

Image

click me for the objects

click me for the floor

Maybe someone can make use of it :)

EDIT: both .rar files contain the files in .3ds .x .obj formats

greets
Tyrus
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

Those look absolutely perfect, thank you so much, ive been going mad all day trying to run this program.:evil: Hopfully now ill go and run it and it wont crash.

You are a legend, cheers :D
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

Okay i just dont understand. The models Tyrus gave me dont work either!

im using the most basic irrlicht code. It makes no sense that it crashes the whole of windows when trying to drawAll(). i have successfully loaded and rendered the sydney mesh from the tutorial, but ANY other mesh, anything at all crashes Win2K never drawing anything!?!?!?!?!!

Skybox works, it only crashes when i load meshes. is it the getMesh()? Should i be doing something different with this if im not loading a .md2 mesh?? If anybody has any clue please reply as i have cut it back to the most basic code i can and it still wont work.

Code: Select all

int CGame::Init()
{
	/*This creates the Irrlicht object under which all other irrlicht members will operate*/
    device = createDevice(EDT_DIRECTX9, core::dimension2d<s32>(640, 480), 16, false,false,false); 
    if (device == 0)
       return 1; // Exit if the Irrlicht object isnt created

    // Create pointers to much used irrlicht interfaces
	 driver = device->getVideoDriver();
	 sceneman = device->getSceneManager();
 
	 // add the camera
	 cam = sceneman->addCameraSceneNodeFPS();
	 cam->setPosition(vector3df(0, 50, 0));

}

void CGame::Prepare()
{
 	// add skybox           
	sceneman->addSkyBoxSceneNode(driver->getTexture("media/irrlicht2_up.bmp"),
driver->getTexture("media/irrlicht2_dn.bmp"),
driver->getTexture("media/irrlicht2_lf.bmp"),
driver->getTexture("media/irrlicht2_rt.bmp"),
driver->getTexture("media/irrlicht2_ft.bmp"),
driver->getTexture("media/irrlicht2_bk.bmp"));

     //THIS IS SAID TO HAVE LOADED BUT CRASHES drawAll() method 
    IAnimatedMesh* mesh1 = sceneman->getMesh("media/floor.obj"); 
    
	IAnimatedMeshSceneNode* node1 = sceneman->addAnimatedMeshSceneNode( mesh1 );
    
	
	if (node1)
	{
		node1->setMaterialTexture( 0, driver->getTexture("media/floor_rock01.jpg") );
	}
}

void CGame::MainLoop() //Original
{
	Render(); // This function draws the scene
		// Update newton 100 times / second
		if (device->getTimer()->getTime() > lasttick + 10)
         {
            device->setWindowCaption(L"Tick Check");
			lasttick = device->getTimer()->getTime();
			//NewtonUpdate(nWorld, 0.01f);    	     }
}

void CGame::Render()
{

	driver->beginScene(true, true, video::SColor(0,220,220,255));
	
	sceneman->drawAll(); // render the scene
	                               //EVERYTHING CRASHES HERE, WINDOWS 2K FREEZES
    driver->endScene(); 

}
Last edited by steveybop on Wed Apr 06, 2005 3:12 pm, edited 1 time in total.
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

here is the command window log:
Irrlicht Engine version 0.7.1
Microsoft Windows 2000 Professional Service Pack 4 (Build 2195)
DirectX9 Renderer
Radeon 7500 ati2dvag.dll 5.13.1.6052
Loaded texture: #DefaultFont
Loaded texture: media/irrlicht2_bk.bmp
Loaded texture: media/irrlicht2_ft.bmp
Loaded texture: media/irrlicht2_rt.bmp
Loaded texture: media/irrlicht2_lf.bmp
Loaded texture: media/irrlicht2_dn.bmp
Loaded texture: media/irrlicht2_up.bmp
Unknown data object in x file: Header
Loaded mesh: media/floor.x
For the .x file it says there is an unknown object, for the .obj is just said loaded mesh, but neither are draw to screen
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

The only mesh that loaded is the objects.obj
This came out strange though. The surface that is closest to the camera seems to be transparent (ie its not shown)

Here is a link to the picture:
\\csfiler\users\mscsdn2005\sl1\public_html\screen.jpg

The picture isnt great, but you can see compared to the original picture, that there are parts not rendering.

Im doing all these posts in the vain hope that anybody has a clue whats wrong with this, as i unfortunatly dont.
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

Is there ANYBODY on this forum, who can help me?

why are these meshes crashing my program. loads of formats are supposed to be compatible but i have only succesfully loaded 2, all the rest crash it WITH THE SAME CODE!!!!!!
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
hybrid

Post by hybrid »

steveybop wrote: Irrlicht Engine version 0.7.1
Ever tried a more recent version of Irrlicht?
Guest

Post by Guest »

You might want to upload that pic to imageshack.us or something...

I see you're using DirectX, have you tried OpenGL?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

What does your main loop look like ???
I copied your code and meshes and it works perfect for the obj files (x and 3ds files have some errors in it !?)...

My system hangs if I use this main loop:

Code: Select all

while(device){
  Mainloop();
}
You should use it like this:

Code: Select all

while(device->run()){
  Mainloop();
}
Maybe this is your fault...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
steveybop
Posts: 30
Joined: Wed Mar 02, 2005 2:52 pm

Post by steveybop »

this is my main loop Acki, straight outta the tutorials:

Code: Select all

                // Main Loop
	while(Game.device->run())
	{
		Game.MainLoop();
	}
Acki, when you say the .obj files worked, you mean floor.obj too? the object.obj worked for me(well it loaded with the foremost faces missing), but not the floor. But if i could get the floor working i could move on and worry about this later. All i need is a big flat floor and some boxes, i could use the test scene node for the boxes but i need some way to make a floor, could i make it as a custom scene node?

Irrlicht 0.7.1 isnt that old, these meshes should work with this version, no? How do i upgrade the version im using, will it mean starting from scratch setting up irrlicht on my computer?
DISCLAIMER: Having read this post & all information therein,you have entered into a legally binding contract.You are obliged to agree wholeheartedly with all opinions expressed within this post.Failure to comply will be deemed a breach of contract.
Post Reply