Newton tutorial updated for Irr 1.0 and NDG 1.53

A forum to store posts deemed exceptionally wise and useful
Post Reply
alc
Posts: 31
Joined: Sun Jun 25, 2006 10:59 pm
Location: Denmark

Newton tutorial updated for Irr 1.0 and NDG 1.53

Post 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.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Nice, thanks for posting.
game
Posts: 13
Joined: Sun Jul 09, 2006 2:47 pm

newton

Post by game »

it does'nt work with me is it because of GCC? or an error done by me?
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post 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
alc
Posts: 31
Joined: Sun Jun 25, 2006 10:59 pm
Location: Denmark

Post 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 ...
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post 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...
alc
Posts: 31
Joined: Sun Jun 25, 2006 10:59 pm
Location: Denmark

Post 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.
game
Posts: 13
Joined: Sun Jul 09, 2006 2:47 pm

Post by game »

thanks I've just seen it and I'll try tomorow :)
Mancuso Raffaele
Posts: 70
Joined: Sat Dec 17, 2005 4:43 pm
Location: licata (AG) italy
Contact:

Post by Mancuso Raffaele »

where can i donwload it?
Bye all,
Mancuso Raffaele (Ares FPS game)
game
Posts: 13
Joined: Sun Jul 09, 2006 2:47 pm

Post by game »

in the tuts page on irrlicht.sourceforge.net
Post Reply