Terrain Wackiness, Problems, Questions

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Democritus
Posts: 1
Joined: Tue Aug 30, 2005 6:00 am

Terrain Wackiness, Problems, Questions

Post by Democritus »

Been doing my first adventures in Irrlicht using Terrain. I've been evaluating this vs. TrueVision.

Problems/Questions
1. As you fly over a terrain, even in the example apps, it warps (perhaps doing some LOD adjustments) as you fly around. This looks awful. Can this behavior be turned off?

2. Is there a heightmap texture limit? I threw my gigantic 2048 X 2048 heightmap and accompanying texture (that runs as smootly as a baby butt in TrueVision) at Irrlicht and it choked (hang before display). I resized them down to 512X512 and it displays.(I think TrueVision manages this problem by breaking things down into 256X256 chunks before rendering. Perhaps this could be done manually in Irrlicht).

3. In the .NET port, I am trying to implement the Triangle selection stuff for "walking" on the Terrain. I use:

Code: Select all

            ITriangleSelector tsel = SceneManager.CreateTerrainTriangleSelector(Terrain, 0);
            
            ISceneNodeAnimator anim = SceneManager.CreateCollisionResponseAnimator(tsel, cam, new Vector3D(60,100,60), new Vector3D(0,0,0), new Vector3D(0,50,0),5f);
            cam.AddAnimator(anim);
It kind of works, but as I fly over the Terrain, it blocks me when I am well above the terrain. It's as if the collision is 50 units too high. Maybe it's just a matter of messing around with Camera settings.

4. Lastly, TrueVision has this nifty Terrain.GetHeight(x,z) function that gives you the height of the Mesh at an xz coordinate. THis is handy for placing objects on the Terrain. I can't see an equivalent in Irrlicht. Would I have "roll my own" by doing some drawline function straight down from above the terrain and the getting a collision point?

Thanks ahead of time for your help.
Foole
Posts: 87
Joined: Mon Aug 29, 2005 10:08 am

Re: Terrain Wackiness, Problems, Questions

Post by Foole »

Democritus wrote:3. In the .NET port, I am trying to implement the Triangle selection stuff for "walking" on the Terrain. I use:

Code: Select all

            ITriangleSelector tsel = SceneManager.CreateTerrainTriangleSelector(Terrain, 0);
            
            ISceneNodeAnimator anim = SceneManager.CreateCollisionResponseAnimator(tsel, cam, new Vector3D(60,100,60), new Vector3D(0,0,0), new Vector3D(0,50,0),5f);
            cam.AddAnimator(anim);
It kind of works, but as I fly over the Terrain, it blocks me when I am well above the terrain. It's as if the collision is 50 units too high. Maybe it's just a matter of messing around with Camera settings.
Yes, that's what that second last parameter is for.. the offset from the center of the collision elipse to the center of the node/mesh.
Guest

Post by Guest »

Thanks Foole. I'll give it a try. Somebody please tell me that there is a way to make it so the terrain does't deform while you walk/fly around.
kaeles-notlogged

Post by kaeles-notlogged »

I believe the warping you are desribing is due to the FOV settings of the camera, you may try playing with this to see if you can get something where it doesnt warp.

I noticed this as well, it seems to be only at the edges of the screen, and so my assumption about the FOV.
Remember though that the FOV is set in radians and not degrees (or maybe its the other way around, i cant remember atm.)
Foole
Posts: 87
Joined: Mon Aug 29, 2005 10:08 am

Post by Foole »

I'd say the warping is due to LOD optimisation. You should be able to alter this using ITerrainSceneNode::OverrideLODDistance.

The .NET wrapper always uses the default LOD count of 5. I think the default values for them are: 1=42.5, 2=68, 3=93.5, 4=119, 5=144.5. Just push them up to higher values and the warping will be much less noticable.
Locked