Terrain set height? (IrrlichtLime)

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
tdkr80
Posts: 18
Joined: Thu Aug 18, 2016 10:15 am

Terrain set height? (IrrlichtLime)

Post by tdkr80 »

I've noticed that there's a method for getting the height value of a terrain, but not setting the height value? How should I go about this, what would be the best method? Will it be difficult to implement and what do you think I should before I begin on this path?

Thanks :).
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Terrain set height? (IrrlichtLime)

Post by hendu »

The terrain's height comes from the heightmap, it's not settable.
tdkr80
Posts: 18
Joined: Thu Aug 18, 2016 10:15 am

Re: Terrain set height? (IrrlichtLime)

Post by tdkr80 »

Surely I could alter the mesh once it has been drawn?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Terrain set height? (IrrlichtLime)

Post by hendu »

Yes, if you use the mesh, but not with the terrain renderer that optimizes the drawing, as it has no logic for that.
tdkr80
Posts: 18
Joined: Thu Aug 18, 2016 10:15 am

Re: Terrain set height? (IrrlichtLime)

Post by tdkr80 »

So maybe I should go the custom scene node route?
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Terrain set height? (IrrlichtLime)

Post by Mel »

Not necesarily if you know how the terrain is created. It really creates all the vertices of the highest level of detail (the most densely populated mesh), so using a custom structure to accelerate the access, you may actually modify the geomipmap terrain. But there is a simpler, and almost as efficient, now a days anyway, way to edit terrains which is to use the terrain primitive (addHillPlaneMesh, from the SceneManager). Irrlicht has two terrains, one is the terrain scene node, which is the terrain with lods, and the other is a primitive which generates a heightfield out of a picture, but it is just a standard mesh you can modify the usual way.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply