![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jul 2009
Location: Frankfurt am Main
Posts: 15
![]() |
Hello,
I have a problem with the tile visibility/terrain altitude when using a custom terrain in World Wind. On the attached images you can see the problem I am facing. First, the custom terrain uses tiling that has the top-level tile covering 180 x 180 degrees, in the format of 16-bit BIL, with current resolution of 129 x 129 vertices (2^n + 1 to allow smooth subdivision of heightfield terrain for easier texture detail adaptation if no altitude interpolation is desirable). The initial subdivision of tiles is 4:2, contrary to the default ratio of 10:5 (DEFAULT_NUM_LON/LAT_SUBDIVISIONS in RectangularTesselator). As you can see from the attached screenshots, the tiles close to the camera are removed or set to the zero altitude, creating holes in the terrain. If the camera angle is changed towards perpendicular view, the tiles reappear with correct elevation. I have experimented a bit and noticed that the following variables have an effect to this behavior: - top level tile size (from 20 to 180 degrees causes removal of tiles from the altitude of 20km already) and initial tile subdivision number - elevation extremes I have made changes to RectangularTessellator to set the number of subdivisions to 4:2 and no other change has been made. The World Wind is still using its default 3D display algorithm, i.e. first getting the list of visible tiles on required (detail) levels according to the distance from the viewpoint, then generating a set of points assuming chosen visible tiles are covered by a grid of 23 x 23 points and calculating altitude of each point by performing row-based linear interpolation of altitude values found in tiles. The BasicElevationModel has been changed to supply for each tile the elevation extremes of -400; 8850 and to accommodate different tile size. I would like to ask you if I am hitting some well-known problem that just happens to work with the default elevation model (before I take a deep look with debugger)? My assumption is that the original tile visibility checking algorithm might have a problem as just by setting different top level tile size with no change to the data format nor tessellator you can notice this problem everywhere. I am sure this is related to elevation extremes, as when these were set to the interval of 0;1 for flat elevation model (0 altitude everywhere), all problems disappeared. I am therefore curious why the interval of -400; 8850 does not work here. I wish you Happy New Year and thank you for any advice! Peter Skvarenina Last edited by Peter Skvarenina; 01-08-2010 at 06:04 PM. |
|
|
|
|
|
#2 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
You should not need to change the tessellator tilling scheme to accommodate your elevation data. As long as your elevation model definition does match you tiles, the globe terrain will tessellate and render properly.
Randomly changing the level zero tile delta can only produce wrong results - it should precisely match your level zero tiles, 180 degrees as you mention it. Why do you think you need to tweak the tessellator in the first place? Please post your elevation model configuration file. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2009
Location: Frankfurt am Main
Posts: 15
![]() |
Patrick,
Thank you for the reply! Attached is the elevation configuration. It's based on the EarthMergedElevationModelAsBil16.xml, with only one sector covering the whole Earth, top level tile of 180 x 180 degrees originating at the south-west corner of Western hemisphere, BIL16 with 129 x 129 point elevation grid. Following your advice, I changed the tessellator back to the default one with subdivision 10:5 ratio, however this didn't change anything. The reason why I was changing the tessellator was due to following your earlier advice (this was however for a different 3D elevation model not based on grid of altitude values - see http://forum.worldwindcentral.com/sh...ad.php?t=21895) You are right that by randomly changing tile delta you cannot expect correct results; the point was however that this would immediately expose the problem I was talking about (even if elevation data are completely incorrect then), i.e. removal of close visible tiles/setting altitudes to 0 for some angles. The problem is immediately noticeable when setting the delta to 180 degrees. After some tweaking I observed that by setting the minimal elevation extreme to -11000 the situation improves as the tiles are set to 0 altitude in much closer distance from viewpoint (screenshot attached). However, this is still not perfect as I need to see elevation data from the distance of 50m or less correctly. Flattening the elevation and setting elevation extremes to interval 0;1 avoids these problems (without this the tiles close to the viewpoint are missing and you can see transparent areas). Also, another observation is that this might be related to the ellipsoid model as latitude seems to have effect on this problem - the distortion in Europe is smaller than in let's say Guadalajara in Mexico. To explain things, I am using a custom tile retrieval mechanism - this mechanism is responsible for downloading and caching the tiles; only the memory cache of World Wind is used (and is purged if necessary). As a result, the World Wind is set to offline mode, the file cache is turned off and the method BasicElevationModel.loadElevations() is changed to use the custom retrieval mechanism. I would be very thankful if you can spot any problem in the configuration file or give me any other advice on how to resolve this problem! Thank you, Peter Last edited by Peter Skvarenina; 01-01-2010 at 01:21 PM. |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jul 2009
Location: Frankfurt am Main
Posts: 15
![]() |
Hello,
I have found the cause of the problem - this behavior occurred in places where the maximal level of terrain was lower than the number of levels specified in the configuration file (14). While I originally assumed the elevation lookup would gracefully fail over to the nearest available elevation level, this wasn't the case. The tiles close to the camera were requesting higher resolution than was available, causing use of default elevation near the camera. After fixing that in the elevation model class, everything seems to be working well ![]() I would like to thank all of you for your excellent work on World Wind! |
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Would you please explain what did you need to fix in the ElevationModel class to get the terrain/tile to appear?
|
|
|
|
#6 |
|
Junior Member
Join Date: Jul 2009
Location: Frankfurt am Main
Posts: 15
![]() |
Hi,
Have a look at the following thread: http://forum.worldwindcentral.com/sh...ad.php?t=24253 Peter |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Feb 2010
Posts: 1
![]() |
You mentioned that you had to add a fix to the elevation model class, by redefining few methods in the BasicElevationModel that return elevation extremes to some pre-defined range such as [-11000, 9000]. Would you please be able to direct me on what methods you had to change?
|
|
|
|
![]() |
| Tags |
| custom terrain visibility |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with terrain and its modification | bako | Development Help | 1 | 02-23-2009 05:35 PM |
| Exception when zooming custom terrain - WWJ | Omega | Development Help | 0 | 10-28-2008 05:24 AM |
| Tile Boundary Problem | Shadre | Development Help | 4 | 04-18-2008 11:20 PM |
| Problem in texture or terrain visualization | gabrio | Technical Support | 5 | 05-27-2006 01:34 AM |
| how to identify tile with missing terrain info | dpatton | Technical Support | 4 | 03-07-2005 07:19 PM |