Irrlicht basics tutorial [Note: HUGE POST]

A forum to store posts deemed exceptionally wise and useful

How would you rate this tutorial?

Great
57
42%
Good
51
38%
Fine
21
15%
Bad
7
5%
 
Total votes : 136

Postby shadowslair » Fri Apr 04, 2008 7:30 pm

This is a really nice tutorial. Still can be improved though. Adding fixed and working versions of the codes will be really nice. I don`t think that there are much guys so fallen in love with the old versions to use it. :lol:
or, another more "accurate" collision function:
Code:

bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getBoundingBox().intersectsWithBox(two->getBoundingBox())) {
return true;
return false;
}

havent tested this one but it should work.


Yeah, actually this always returns "true". I would like to know what`s wrong with it too (if possible).

Anyway, this tut is really useful, since it helped me understand some basic stuff. "Working and learning" seems to be a good startegy :wink:
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby MasterGod » Wed Apr 09, 2008 6:29 am

So, does anyone knows what's wrong with it?
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
MasterGod
 
Posts: 2060
Joined: Fri May 25, 2007 8:06 pm
Location: Israel

Postby dudMaN » Sat Apr 19, 2008 7:35 pm

shadowslair wrote:This is a really nice tutorial. Still can be improved though. Adding fixed and working versions of the codes will be really nice. I don`t think that there are much guys so fallen in love with the old versions to use it. :lol:
or, another more "accurate" collision function:
Code:

bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getBoundingBox().intersectsWithBox(two->getBoundingBox())) {
return true;
return false;
}

havent tested this one but it should work.


Yeah, actually this always returns "true". I would like to know what`s wrong with it too (if possible).

Anyway, this tut is really useful, since it helped me understand some basic stuff. "Working and learning" seems to be a good startegy :wink:


Yeah, tested that out on something(dont remember what) and it always returns true. I'm ganna remove that sometime :shock: .

-DudMan
Complete Irrlicht Beginners Tutorial
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24898
User avatar
dudMaN
 
Posts: 111
Joined: Fri Mar 02, 2007 6:37 pm

Postby MasterGod » Sun Apr 20, 2008 3:30 pm

But it Should work, doesn't it?
We need to find why it is almost always true (I somehow had few falses in some cases)..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
MasterGod
 
Posts: 2060
Joined: Fri May 25, 2007 8:06 pm
Location: Israel

Postby BlindSide » Sun Apr 20, 2008 3:48 pm

You should use ->getTransformedBoundingBox()

Infact, I went over this months ago on IRC with you dudMaN, didn't I?

But it Should work, doesn't it?


No, no it shouldn't, if you dont return the Transformed bounding box, it just gives you one thats always placed at 0,0.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2804
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby MasterGod » Sun Apr 20, 2008 4:06 pm

"Transformed":?:
Could you explain please what do you mean. I guess you're right and I'll try that tomorrow when I get home but I'm not familiar with the term 'Transformed' in relation to graphics.

Thanks.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
MasterGod
 
Posts: 2060
Joined: Fri May 25, 2007 8:06 pm
Location: Israel

Postby hybrid » Sun Apr 20, 2008 8:31 pm

Transformed to World coordinates. Similar to getAbsolutePosition compared to getPosition.
hybrid
Admin
 
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Postby MasterGod » Mon Apr 21, 2008 9:58 am

hybrid wrote:Transformed to World coordinates. Similar to getAbsolutePosition compared to getPosition.
:o , Thanks :!:
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
MasterGod
 
Posts: 2060
Joined: Fri May 25, 2007 8:06 pm
Location: Israel

Postby Ola » Mon Apr 21, 2008 12:10 pm

I think (maybe i am wrong) the code should look like this:

bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getTransformedBoundingBox().intersectsWithBox(two->getTransformedBoundingBox())) {
return true;
}
return false;
}
Ola
 
Posts: 1
Joined: Mon Apr 21, 2008 12:09 pm

Postby MasterGod » Mon Apr 21, 2008 8:51 pm

Ola wrote:I think (maybe i am wrong) the code should look like this:

bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getTransformedBoundingBox().intersectsWithBox(two->getTransformedBoundingBox())) {
return true;
}
return false;
}


That's what BlindSide said :wink: ,
And better be: return if(one->...)
so if it's true it would return true or false otherwise.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
MasterGod
 
Posts: 2060
Joined: Fri May 25, 2007 8:06 pm
Location: Israel

Postby dudMaN » Tue Apr 22, 2008 10:20 pm

BlindSide wrote:You should use ->getTransformedBoundingBox()

Infact, I went over this months ago on IRC with you dudMaN, didn't I?

But it Should work, doesn't it?


No, no it shouldn't, if you dont return the Transformed bounding box, it just gives you one thats always placed at 0,0.


Blindside: thanks.

All the people who clicked the link from tut:

Code: Select all
bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getTransformedBoundingBox().intersectsWithBox(two->getTransformedBoundingBox())) {
return true;
}
return false;
}



-dudMan
Complete Irrlicht Beginners Tutorial
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24898
User avatar
dudMaN
 
Posts: 111
Joined: Fri Mar 02, 2007 6:37 pm

Postby shadowslair » Wed Apr 23, 2008 6:59 am

It`ll be a good idea to replace the buggy with the working code in the first page of the tutorial. It would be best I think... :roll:
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby BlindSide » Wed Apr 23, 2008 7:12 am

Why not:

Code: Select all
bool collision(ISceneNode* one, ISceneNode* two)
{
return (one->getTransformedBoundingBox().intersectsWithBox(two->getTransformedBoundingBox()));
}
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2804
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby shadowslair » Wed Apr 23, 2008 12:41 pm

He-he...

I think there are many ways to achieve something, but it will be useless to write down all of these in the tutorial. Let`s say:

TUTORIAL 4: Collision detection

Type this:
(...)
Or this:
(...)
Why not this
(...)
This will do the job too
(...)
An on, and on...

PS:Anyway it`s really nice you found another composition of the solution. :wink:
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Postby MasterGod » Wed Apr 23, 2008 7:08 pm

MasterGod wrote:
Ola wrote:I think (maybe i am wrong) the code should look like this:

bool collision(ISceneNode* one, ISceneNode* two) {
if(one->getTransformedBoundingBox().intersectsWithBox(two->getTransformedBoundingBox())) {
return true;
}
return false;
}


That's what BlindSide said :wink: ,
And better be: return if(one->...)
so if it's true it would return true or false otherwise.

I suggested it first :? :P lol..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
User avatar
MasterGod
 
Posts: 2060
Joined: Fri May 25, 2007 8:06 pm
Location: Israel

PreviousNext

Return to FAQs, Tutorials, Howtos, and external tool lists

Who is online

Users browsing this forum: No registered users and 0 guests