Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-16 Thread Rodrigo Dias
Thank you, Glenn, but this part was already solved. About sending the camera's coordinates to screen text, I've found a solution elsewhere: Code: Vec3f eye; while ( !viewer.done() ) { eye = viewer.getCamera()->getInverseViewMatrix().getTrans();

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-10 Thread Glenn Waldron
Rodrigo, To load a png you need to replace TMSOptions with GDALOptions. On Mon, Jan 7, 2019, 12:21 PM Rodrigo Dias Hi, > > Following this example ( > http://docs.osgearth.org/en/latest/developer/maps.html#programmatic-map-creation), > I'm trying to use a PNG instead of a link (like the example

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-08 Thread Rodrigo Dias
So, I learned how to put HUD text, and I'm trying to understand the movement of the camera sending the camera's coordinates to this text. However, the three coordinates (heading, pitch and roll) are always 0 or pi, which seems more a rounding error than anything else. It seems the world is

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-08 Thread Rodrigo Dias
> If you feed the TIFF LWZ coder the same 4-bit data as the PNG is made form, I > would think it would code about as efficiently, even if the data is stored in > an 8-bit representation. I used QGIS to convert from PNG to TIFF. The image only has 16 colors, so maybe it's QGIS fault. Later I

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-08 Thread Chris Hanson
If you feed the TIFF LWZ coder the same 4-bit data as the PNG is made form, I would think it would code about as efficiently, even if the data is stored in an 8-bit representation. Forward-dictionary compression systems work on how many unique symbols are found and if you make a 16m color image

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-08 Thread Rodrigo Dias
Hi, Sorry, I didn't post the updated code: Code: #include #include #include #include #include #include #include #include #include using namespace std; using namespace osg; using namespace osgEarth; using namespace osgEarth::Drivers; int main (int argc, char** argv) {

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-08 Thread Chris Hanson
How big is the TIFF and the PNG? They use similar compression methods (PNG is ZIP/Deflate and compressed TIFF is usually LZW and can also use ZIP/Deflate) so you ought to be able to get them fairly close in size. What are the total pixel dimensions of the image? Your best result might not be from

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-07 Thread Rodrigo Dias
Well, I managed to create a georeferenced texture file in TIFF format. However, since it's about twice the size of the PNG (even compacted with LZW), it would be great if PNGs could be used instead. I also managed to make the map projected (flat), by adding the following code in the beginning:

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-07 Thread Rodrigo Dias
Ok, Chris, I got it. Is there any way to tell the program where to put the PNG image? Or must I use a georeferenced TIFF? Other thing, the XML documentation (http://docs.osgearth.org/en/latest/references/earthfile.html#map) explains that I can choose between a geocentric (ellipsoidal) or a

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-07 Thread Chris Hanson
Ok, so if you're adding an image layer programmatically, you *don't *want to add a .earth XML file. It should probably look something like // Add an imagery layer { GDALOptions gdal; gdal.url() = "br.png"; osg::ref_ptr layer = new

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-07 Thread Rodrigo Dias
Hi Chris, following the example, I thought I could use directly a PNG instead of a .earth XML. Now I tried a XML. My source code, main.cpp: Code: #include #include #include #include #include #include #include #include using namespace std; using namespace osgEarth; using namespace

Re: [osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-07 Thread Chris Hanson
Can you show your exact code and the .earth XML file? It sounds to me like it failed to open/load the XML file. Is it a file path/permisssions issue? On Mon, Jan 7, 2019 at 6:13 PM Rodrigo Dias wrote: > Hi, > > Following this example ( >

[osg-users] [3rdparty] Use PNG as texture for terrain in osgEarth

2019-01-07 Thread Rodrigo Dias
Hi, Following this example (http://docs.osgearth.org/en/latest/developer/maps.html#programmatic-map-creation), I'm trying to use a PNG instead of a link (like the example uses a TIFF for elevation). However, I got the following error: > [osgEarth]* Error in XML document: Error document