Odd problems with terrain

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.
Post Reply
Alien

Odd problems with terrain

Post by Alien »

I've been having odd problems with terrain:
- While the player is walking along the terrain, sometimes the triangles disappear near its feet and stuff, its just noticeable when u look around
- Sometimes the player randomly falls through the terrain...i think this is due to the above
- While the player is walking along the terrain, it sometimes gets stuck...just stops moving and you have to walk backwards...some problem with the triangle selector maybe..

Theres problems seem kinda weird and indicate that i'm probably using an innappropriate scale for the terrain or something. So has anyone else had problems like these, what scale should i set my terrain to ? heres some code snipets i use so u get an idea of what scale i'm using...

Code: Select all

terrain->setScale(core::vector3df(160, 20, 160)); //scale of the terrain

smgr->createTerrainTriangleSelector(terrain, 1); //the triangle selector


smgr->addCameraSceneNodeFPS(0, 100.0f, 500, -1, 0, 0, false); // cam

//The gravity and sphere for the camera
smgr->createCollisionResponseAnimator(
		selector, camera, core::vector3df(100,500,100),
		core::vector3df(0,-98,0),///gravity 
		core::vector3df(0,0,0));
Miik3h (offline)

Post by Miik3h (offline) »

I am not really sure, ...

But your ellipsoid radius looks extra large,... might be somehow connected...

Try,

Code: Select all

smgr->createCollisionResponseAnimator( 
selector, camera, core::vector3df(30,60,30), 
core::vector3df(0,-98,0),///gravity 
core::vector3df(0,0,0));
See if it helps any of your problems...
Guest

Post by Guest »

Even with a smaller radius i have the same problem. It seems that some traingles are simply not being detected by the triangle selector! I walk around and just fall through the ground...i can send an example if anyone wants.
Alien

Post by Alien »

I started a new project using a level i modelled that has a polygon made terrain ( only 10 by 10 vertices though ) and while the player wont fall through the terrain the player does occasionally get stuck when walking around. I made a scale variable, and experimented with different sizes. With a large scale, the player refuses to move, with a smaller scale, the player doesn't get stuck as often. In terms of Irrlicht units, what size should 1 meter be ?
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

There are many bugs with the terrain in Irrlicht-0.12. IrrSpintz has an updated terrain node which fixes many of them, including these. There are still some bugs to iron out with it, but this is fixed. It has some to do with the Terrain but also the collision in Irrlicht-0.12 is broke.
Image
Alien

Post by Alien »

Man those improvements are fantastic, well done. Sadly, they dont fix the problems i'm having. When you say the collision system is broke...do u mean it works better in older versions ? Its so odd the way that on some polygons the player just stops moving like they'd hit a wall...even ones which are flat...
Guest

Post by Guest »

core::vector3df(100,500,100),
core::vector3df(0,-98,0),///gravity
core::vector3df(0,0,0));
Or maybe

Code: Select all

core::vector3df(60,100,60),
         core::vector3df(0,-9.8,0)//gravity looked a little strong
         core::vector3df(0,50,0);
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

i saw the same and it is most prominent when the terrain node is scaled UP
It -seams- like there is an 'upper limit' for the distance between vertices in the terrain-mesh?
It will be very nice to have that problem fixed in a new release-
@ Spintz, Will u inform Niko, or have u submitted a bug-repport?
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

their are posts in the Bug Reports forum. The one i remember offhand is the DirectX FPU Precision fix, another was to normalize plane normals or something like that, and a couple of the algorithms had some bad math, forget which ones. It's in changelog for irrSpintz think

Here's the list of Collision Changes/Addons
  • Fixed bug in triangle3d::isOnSameSide [ return true if the dorProduct is greater than or equal to 0.0f, not just if it's greater than 0.0f ]
  • Fixed bug in triangle3d::getIntersectionOfPlaneWithLine [ normalize the triangle normal vector ]
  • Fixed bug in aabbox3d::intersectsWithLine [ e and t were being calculated wrong ]
  • Fixed bug in CTerraiCTerrainTriangleSelector::setTriangleData [ the triangles need to be generated from the RenderBuffer vertices, not the Mesh vertices ]
  • Fixed bug in CSceneCollisionManager::getCollisionPoint [ linevect needs to be normalized and minor speed-ups in determining nearest trianle ]
  • Added CSceneCollisionManager::getCollisionPoints, which can give you the near and far intersections of a line with a box.
Image
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

ok, thank you Spintz
(i will make a link to this post in the bug repport)
-------
dident because -this-
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=8689
is already there
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Post Reply