Page 1 of 1

Newton tutorial updated for Irr 1.0 and NDG 1.53

Posted: Fri Jun 30, 2006 10:32 am
by alc
I've updated the Newton/Irrlicht tutorial to Irrlicht v. 1.0 and NDG 1.53. Actually, only minor changes are necessary, so I'll list them here:

1) Change

Code: Select all

device = createDevice(EDT_OPENGL, dimension2d<s32>(1024, 768), 16, false, true, this);

to

device = createDevice(EDT_OPENGL, dimension2d<s32>(1024, 768), 16, false, true, false, this);
2) Change

Code: Select all

NewtonBodySetFreezeTreshold(tmp->body, 1.0, 1.0, 1.0, 1.0);

to

NewtonBodySetFreezeTreshold(tmp->body, 1, 1, 1); 
3) Add

Code: Select all

tmp->node->setMaterialFlag(EMF_LIGHTING, false);

after

tmp->node->setMaterialTexture(0, driver->getTexture("data/crate.jpg"));
Hope I got it all. Otherwise, throw me a note.

Posted: Sun Jul 02, 2006 9:13 am
by niko
Nice, thanks for posting.

newton

Posted: Mon Jul 10, 2006 9:34 pm
by game
it does'nt work with me is it because of GCC? or an error done by me?

Posted: Tue Jul 11, 2006 6:57 am
by TheGameMaker
@alc you have to change the for loop, where all tris are sended to newton to following:

for (j=0; j<mb->getIndexCount(); j+=3)

just have a look in the bugforum.....

TGM

Posted: Tue Jul 11, 2006 11:34 pm
by alc
@game: You're right, it does not work. I accidentally switched to an older newton engine during testing. Realizing this I asked the moderator to remove this post. He hasn't, I see.

@TGM: That is actually not a bug, that is some sort of copy/paste error. I guess somehow some editor somewhere in the process interpreted <...> as an HTML directive or the like and replaced the code. That I did correct (and forgot when posting this tut fix). Still, the tut did not work for me. It does work with irr 1.0 and the (older) newton engine that comes with the example in the zip file. However, I could not get it to work with newton 1.53. Does it work for you with the newest newton engine?

Now I have unloaded newton, as I did not really need it (just checking it out). Note that you CAN make it work by increasing the size of the createbox from (38,38,38) to (65,65,65) or by using a sphere rather than a box for the newton body (not very useful fixes, but it does work). I learned this from some post that I cannot seem to find now. In fact, I've just scouted the forum and I cannot find any posting with a definate solutions to this, so ...

Posted: Wed Jul 12, 2006 8:59 am
by TheGameMaker
hmm...ok stupid Html editors :D
I dunno why your tutorial doesn´t work with the new engine... but for me, it works very well... not the code direct out of the tut but mostly the same.... The only Problem I had, was that i scaled the newton world to small :lol: but, if it helps you i would upload my version of your tut...

Posted: Wed Jul 12, 2006 8:44 pm
by alc
Personally, I do not need it. But I guess that it would be nice for other users to have a working tut. Perhaps you should sent it to niko (site admin) to put on the newton tut page. There are only few things more frustraing than a tut that ALMOST works ...

Btw, I did try to resize the newton world, as the newer versions of the Newton engine freezes objects outside the world. But my attempt were futile. Perhaps, I resized it wrongly, somehow; dunno.

Posted: Sat Jul 15, 2006 2:53 am
by game
thanks I've just seen it and I'll try tomorow :)

Posted: Sat Jul 15, 2006 2:00 pm
by Mancuso Raffaele
where can i donwload it?

Posted: Sat Jul 15, 2006 2:58 pm
by game
in the tuts page on irrlicht.sourceforge.net