Author Topic: How can I make Geomipmapping 3D terrain from GeoTiff(ASTER GDEM)+online map.  (Read 2687 times)

Offline airfoil

  • byte
  • *
  • Posts: 7
    • View Profile
 :DHello,
I am a android app developer and want to make 3d terrain map using ASTER-GDEM(GeoTiff) file.
I find the following three samples.

1. appropriate 3d terrain generation source code from DEM files.
2. method or class of reading GeoTiff files.
3. method or class of applying on and offline map texture.

Thanks for advance.
SH.Woo

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
I'm not sure what your actual question is? If you ask if there is some magic class that does this, then i don't know of any.

Offline airfoil

  • byte
  • *
  • Posts: 7
    • View Profile
Dear EgonOlsen
Sorry for bothering you.

My question is too broad because I don't know anything.
Now, I am making a concept for my project.
Anyway, I want to change my question on detail or smaller.

1. How can I apply vertex array to plane?
2. How can I make group of plane? (Object3D mergeAll ?)
     When I mergeAll several Object3Ds, what is each Object3D's positioning method?
3. Is there different between plane's quard and mesh concept?

At first, here only. my question is poor yet.

Thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
What do you mean by "apply vertex array to plane"? Dynamically alter a plane to that it forms some landscape or create an Object3D out of some vertex data at load time or...?

Offline airfoil

  • byte
  • *
  • Posts: 7
    • View Profile
I want to make a app like below picture.


The online map is consist of several tiles.
When I do zoom in or out, resolution of the tiles(plane) is changed for speed and detail focus.
Online map tiles(texture) and tile's vertex resolution is also updated.

ElevMaps app show excellent performance. But my project target is over it.
More detail terrain 3d map, track play, replay flying, etc...

What is your first tip for this project target?
I will start to study from that point.

Thanks
« Last Edit: June 13, 2014, 11:51:44 pm by airfoil »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Sounds like a piece of work.... ;) There's a way to modify a mesh by extending the GenericVertexController. I would start with creating a plane with the desired polygon count and modify it based on the height map (asuming that you have something like this). That's one way of of adjusting a mesh at runtime. Creating new objects for each zoom level will be too expensive in terms of memory on processing power. The fastest solution might be to do the calculations in a shader instead that gets the height information as additional vertex attributes and applies them. But that means that you have to dive into GLSL as well. If you want to avoid that for now, i would try my luck with the GenericVertexController approach. Maybe encapsulated in a way that it's easy to replace it with a shader based approach if that's ever needed.

BTW: This seems to be similar to this: http://www.jpct.net/forum2/index.php/topic,3782.0.html

Edit: Typos...

Offline airfoil

  • byte
  • *
  • Posts: 7
    • View Profile
Dear EgonOlsen
Thanks for your correct answer.

Now, I can start my porject and I am trying to compose test code.

Here, I have a question.

1. If I use just one plane(have 75*75 mesh), how I can apply to several map tile texture?
    That plane will has 25(5*5) tiles. So, I have to add 25 map tiles into a plane at runtime.

2. I want to implement bird view mode. So, each rotateX, rotateY should be worked as limited angle or axis.
    For example, the plane has fixed camera position and should move only around center vertical axis and viewed X axis.
    Do you have an idea?

Thanks in advance.
SH.Woo

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
I'm not sure what you mean exactly by the first question...
And almost the same applies to the second one. Do you want to rotate the camera or the plane? And what's the problem with doing so?

Offline airfoil

  • byte
  • *
  • Posts: 7
    • View Profile


I explain my questions again as above images.

1. A plane is consist of textures of 25 map tiles. each map tile will be downloaded in each thread.
    And the plane has 75*75 mesh. So I want to insert a tile to 15*15 mesh of the plane.

2. I don't want to move camera position. It's clear. I just move the plane on the above 2 axis.

Thanks in advance.
SH.Woo

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
I'm still not sure what the actual question is...mainly because i'm not sure what the input format actually is. Do you have a height map or some mesh data or what? If it's a height map, i would create a plane of the required size and polygon count and modify it based on the data from the height map by using the IVertexController approach that i described above.
About the rotation...I think that the map consists of multiple planes/parts? If so, the best approach might be to create a dummy object and place it at the desired rotation pivot in world space. Then make all map tiles children of that dummy object and rotate the dummy to rotate all map tiles at once.

Offline airfoil

  • byte
  • *
  • Posts: 7
    • View Profile
Sorry for bothering you.
Every time, a wise answer to a silly question.
Anyway, question 2(rotate on plane's pivot axis) was solved.

Solution was this : mapPlane.rotateAxis(mapPlane.getZAxis(), touchTurn); mapPlane.rotateX(touchTurnUp);

About question 1:
Yes, I have a height map. But I use sample height map currently. Next time I'll make the real height map.

mapPlane = Primitives.getPlane(75, 1);
mapPlane.setTexture("mapTiles");

As above code, I can apply only one texture to a plane.
I want to apply several textures(matrix) to a plane.

The following is my current level.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
You could create several smaller planes (one per texture), assign the textures and then merge the objects into one. You just have to make sure that they have been translated correctly and that the translation has been made permanent (translate/translateMesh). Another solution would be to use the PolygonManager on the plane. But this has to be done before calling build().

Offline atreyu64

  • byte
  • *
  • Posts: 44
    • View Profile
Hi, it's really funny that I've just come across this topic right now, because I may soon have to develop an app using a much more bigger area than I had before.
So I was thinking of using "Geomipmapping" or other solution to load dynamically a huge terrain (huge model and huge texture, from real world).

I've given Ardor3D a try because it implements a solution ( https://github.com/Renanse/Ardor3D/wiki/Terrain ), but I'm giving up as it's poorly documented, much more difficult to use than jpct, and seems to be kind of obsolete.
So for now I don't know how to do it, I'll maybe just keep things static but try to reduce mesh / texture as less as possible, as the app would only have to run on a recent PC (no android version planned for now).
By the way do you know a GPU allowing to load textures bigger than 8192 ? And is there a limitation in the max number of polygons in JPCT / OpenGL ?

Anyway, I'm still working on my other apps (with reasonable mesh and texture sizes...), I've developped an editor allowing to pick/modify hiking ways (polylines), to create and place signs (billboards), etc... so as my partner (not a computer scientist) can at the same time create contents easily.
We still plan to release theses apps (one app for each montainous region) as soon as possible, but we really want to polish it a lot and it takes some time... I'll keep you in touch !

Offline airfoil

  • byte
  • *
  • Posts: 7
    • View Profile
Dear EgonOlsen
Long time no see. around 2 months.

My project is on final stage.
But there are the following many problems.
Last your simple comments are very helpful and correct.
Please, give your help again.

<Developing story>
1. To develop ASTER(world terrain elevation model) tile base service.
2. Flight track loading.

The following image is current level.


The problems are...
1. JPCT loading time is too long.(around 10 seconds..)
    Resuming is also too long.
    Is there the solution for reducing loading time?
2. Track polylines is about 20,000~50,000 lines.
    I have to use different color in each interval. So I used polyline array.
    Finally, FPS is lowest.
    Polyline redraw is too heavy work in android phone.
    Is there any solution?
3. Even though this 3D track view activity was finished, when I restart the activity, many problems comes out.
    How can I destroy GLSurfaceView clearly?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
  • That highly depends on which file format you are loading in which way and how you are handling pause/resume. It's impossible to answer that question without further details.
  • I don't think so. x0000 line segments are a lot. The only solution that i can think of it to reduce the amount of line segments if possible.
  • Again, "many problems" is very vague. It's impossible to answer this without further details on the kinds of problems. What i usually do, it do store the state of the app in some static variable (similar to what the examples do) and store the gl context. On resume, i simply repopulate the current instance with the stored values and if the gl context hasn't changed, i'm also reusing the frame buffer. Works fine for me, never had a single problem with that and it's the fastest way to resume things anyway.