Page 1 of 1

Terrain map

Posted: Wed Aug 09, 2017 3:22 am
by RainBoy
Hi guys,

I need to generate terrain view in very precisely mode. lets presume i have input data that represents point cloud of XYZ coordinates for each point.
Also, I can convert it to the LandXML format as well. I want to use Irrlicht engine to represent that data as some kind of pavement (terrain) in wireframe node, but as accurate as possible
What is my options? Should i have to convert that input files to BMP with related darkness for each point? Will that affect result (I mean accuracy)?
Also, i noticed Irrlicht decrease number of polygons when you are moving camera away of object. Is it possible to change this settings and keep as much polygons as I want even if camera is far away?
I can use really good hardware so it is not an issue.

If you can help me to decide to use another engine that can do this job better for me it will be very helpful as well. For me it does not look like a normal way to use 3D engine, it is more like CAD system. I need to add later ability o plot lines / measure distances between selected objects on a 3D view/ etc..

I will prefer to use C# or Delphi.

Thank you so much,
Alex.

And btw 1 more dumb question. Any 64 bit version of Irrlicht library for now?

Re: Terrain map

Posted: Wed Aug 09, 2017 10:26 am
by CuteAlien
OK, I'm unfortunately not very familliar with the terrainscenenode (didn't really use it myself yet), but maybe can help a little anyway.

Will terrainscenenode work for you at all when got a point-clound? I'm asking because that node seem to use a regular grid - so it doesn't really seem the best representation for a random cloud (as you could only average points to nearest grid). Sound like you might be better off using your own scenenode for this where you draw some graph for your point-cloud (bottom of this article has a bunch of interesting graphs to use for triangulating point-clouds).
You could use for example the draw3DLine functions of the videodriver in your node. They are somewhat OK to use for such stuff when you are on OpenGL as it allows to control line-thickness with materials (D3D does not support that).

As for LOD - from interface it looks like it has a few functions to control that. Like ITerrainSceneNode::overrideLODDistance. Check the documentation for that class.

Irrlicht has some wrappers for C# and maybe even Delphi (I remember there had been one, not sure if it's still under development). But I never worked with those myself as my projects are all in c++.

Never heard before about the LandXML format. It sounds somewhat interesting.

Re: Terrain map

Posted: Wed Aug 09, 2017 2:19 pm
by RainBoy
Thanks for the answering!
When i checked my input data it looks like a regular grid almost everywhere, so i probably need to implement small part of interpolation.
Anyway, I will try to use draw3DLine call and will check for result. I need to colorize that triangles by special algorithm and be able to zoom in/out/rotate resulted data.

Re: Terrain map

Posted: Fri Oct 06, 2017 7:52 pm
by realmsinthemists
Isn't it possible to use a shader to draw a wireframe too, including colouring? Because draw3DLine is relatively slow and you're gonna draw a lot of lines. For a 3x3 grid you draw 12 lines. For 5x5 they are 50 already.

When you dive into ITerrainSceneNode it looks kinda difficult. In fact it is pretty straight forward. ITerrainSceneNode::overrideLODDistance, you can set distances yourself, also the size of patches which make it more detailed or not. There is only this small issue with the size of the terrain. If you have a bmp of 256x256 and a patch size of 17, the terrain will be 240x240 at identity scale.

You could, of course, copy the terrain node code into a new file, rename it and remove a lot and change the rest.

Take a look at 23.SMeshHandling, it shows a few neat tricks that can be usefull for you.

r,