Andy Spencer [Mon, 25 Jan 2010 08:03:37 +0000 (08:03 +0000)]
Convert for expose callback to callback objects
Objects are now added using a level and a sorting parameter
- Levels are rendered in order
- Semi-transparent objects should be added with sort=TRUE
(note: this is currently broken)
Andy Spencer [Sat, 19 Dec 2009 22:59:49 +0000 (22:59 +0000)]
Convert from xyz to lle as the main roam coordinates
This keeps splits along latitude lines instead of along great circles.
It is a little less accurate, but makes texture mapping much simpler, at
least with Mercator projections.
If we ever manage to get lle->xyz conversions done in an OpenGL shader,
this should make the transition a little easier as well.
Old Way New Way
.-''/'''-. .-''/'''-.
/ __/_____ \ /.__/____..\
/'' | ''\ / | \
*..__*_____..* *..__*_____..*
\ | / \ | /
\ \ / \ \ /
'-..\...-' '-..\...-'
Andy Spencer [Sat, 14 Nov 2009 13:38:33 +0000 (13:38 +0000)]
Refactor GisViewer and GisOpenGL
- GisViewer is an abstract type that extends GtkDrawingArea
- GisOpenGL extends GisViewer and is the core of the library.
It is always accessed though the GisViewer API
Andy Spencer [Sat, 14 Nov 2009 08:45:52 +0000 (08:45 +0000)]
Add primitive rendering types
These types are not full GObjects, hopefully they will be faster and
more space efficient this way since there will likely be a very large
number of these objects. However, the API is similar.
GisProjection:
Stores camera parameters.
GisPoint:
Corresponds to OpenGL Vertex.
GisPrimitive:
Base class for primitive drawing objects.
- Contains a centroid for depth sorting
- Contains a projection so that xyz values for vertexes associated with the
primitive points can be store relative to a projection.
GisTriangle:
For GL_TRIANGLES
GisQuad:
For GL_QUADS
GisCallback:
Contains a callback and user_data pointer that is called when the object is
to be rendered.
Andy Spencer [Tue, 10 Nov 2009 00:23:44 +0000 (00:23 +0000)]
Fix rendering plugins if they're loaded after radar.so
Radar sets glColor to transparent at the end of it's expose, this was
never reset to something opaque so the world was being drawn
transparent. Fixed by resetting glColor in set_visuals.
Andy Spencer [Mon, 9 Nov 2009 13:24:54 +0000 (13:24 +0000)]
Add Shuttle Radar Topography Mission plugin and height code
For the most part, the SRTM plugin is simmilar to the BMNG plugin. The
loaders are more complicated because it generates both a bil (unsigned
short array) and a pixmap from the downloaded files.
Highmaps are in two parts when set_height_func is called with
update=TRUE, the heights of all the vertices for a given tile are
updated by calling height_func and using the returned value as the new
vertex height.
In addition to updating the vertex height immediately, the height
function is also stored in each vertex and used later during the
split-merge process.
The user_data passed with set_height_func could theoretically be used to
speed searching for the correct tile during the split-merge process, but
this is currently not done. (Each call to the srtm height function does
a search for the correct tile)
Andy Spencer [Mon, 9 Nov 2009 12:37:58 +0000 (12:37 +0000)]
Add Blue Marble Next Gen plugin and tile rendering code
Tile Splitting:
(These functions were skipped in the previous commit for GisTile)
To update a set of tiles, the plugin responsible for the tiles needs
to periodically call the update function which will split any tiles
that are below the viewers desired resolution.
Unlike the WmsInfo method, the tiles are not automatically updated
when a particular tile is requested. (In fact, requesting a particular
tile is rarely done).
Tile Rendering:
Rendering with GisTile is significantly different than with WmsInfo
and fans. This difference is easily explained with some pseudocode:
Old way:
for triangle in mesh:
for tile in find_tiles(triangle):
render(triangle, tile.texture)
New way:
for tile in tiles:
for triangle in find_triangles(tile):
render(triangle, tile.texture)
Both find_tiles and find_triangles are O(log n) operations in the
worst case, but I think using find_triangles should result in faster
code because find_triangles can quickly return a large group of tiles,
while the find_tile function typically reruns a single tile. There's
additional discussion of this in the source code.
From an implementation standpoint, the new way makes it easier to add
plugins. With the old way, the find_tiles function was invoked by a
function pointer attached to the sphere, which makes rendering
multiples layers of tiles difficult. In the new, each plugin just
calls the render_tiles function which renders a set of tiles
(recursively) on top of the sphere.
Andy Spencer [Mon, 9 Nov 2009 12:02:23 +0000 (12:02 +0000)]
Add GisTile and GisWms and update wms_test accordingly
GisTile:
* Represents a lat-lon tile
* May contain pointers to child tiles of higher resolution
GisWms:
* Contains Web Map Service support functions
GisWms and GisTile roughly translate to WmsInfo and WmsCacheNode. The main
difference being that the new versions are more independent of each other so
non-wms downloaders can be used in the future.
The other major difference is that GisTile is not transparent as WmsCacheNode
was. That is, there is no gis_tile_fetch function which automatically updates
the tiles.
Andy Spencer [Fri, 30 Oct 2009 04:58:08 +0000 (04:58 +0000)]
Reorganize BMNG and SRTM into plugins
- Create dummy plugins in src/plugins for bmng and srtm.
- Optimize Roam code:
- Fewer height and projection updates
- Cache triangle l-r midpoints and share them with children
- Also remove a lot of trailing whitespace
Andy Spencer [Wed, 2 Sep 2009 14:42:02 +0000 (14:42 +0000)]
Removing ridge plugin and moving exmaple plugin
Ridge plugin is deprecated due to libGIS. The example plugin has been
moved out of the autoconf source tree into the stand-alone examples
folder. Wms, Roam, and GPQueue headers now included in the install.
Andy Spencer [Mon, 25 May 2009 01:48:49 +0000 (01:48 +0000)]
* Fixing some async issue (w/ gthread_init)
* Consistent debug messages
* Debug levels
* Command line arguments
* Making AWeatherGui a subclass of GtkWindow